mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 23:51:28 +03:00
utmp: if we don't have a previous runleve, just store 0
This commit is contained in:
parent
858a9b0a99
commit
d7fc909db3
@ -193,8 +193,12 @@ int utmp_put_runlevel(usec_t timestamp, int runlevel, int previous) {
|
||||
if (previous <= 0) {
|
||||
/* Find the old runlevel automatically */
|
||||
|
||||
if ((r = utmp_get_runlevel(&previous, NULL)) < 0)
|
||||
return r;
|
||||
if ((r = utmp_get_runlevel(&previous, NULL)) < 0) {
|
||||
if (r != -ESRCH)
|
||||
return r;
|
||||
|
||||
previous = 0;
|
||||
}
|
||||
|
||||
if (previous == runlevel)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user