mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-21 06:03:39 +07: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