1
0
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:
Lennart Poettering 2010-04-24 00:31:21 +02:00
parent 858a9b0a99
commit d7fc909db3

View File

@ -193,9 +193,13 @@ 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)
if ((r = utmp_get_runlevel(&previous, NULL)) < 0) {
if (r != -ESRCH)
return r;
previous = 0;
}
if (previous == runlevel)
return 0;
}