chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
858a9b0
)
utmp: if we don't have a previous runleve, just store 0
author
Lennart Poettering
<lennart@poettering.net>
Fri, 23 Apr 2010 22:31:21 +0000
(
00:31
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 23 Apr 2010 22:31:21 +0000
(
00:31
+0200)
utmp-wtmp.c
patch
|
blob
|
history
diff --git
a/utmp-wtmp.c
b/utmp-wtmp.c
index 1650d10eba753cd7a8c065ff32ed1e07489e7ded..0cc9ceca84b3014b2a36c6ddd07736c5021713e7 100644
(file)
--- a/
utmp-wtmp.c
+++ b/
utmp-wtmp.c
@@
-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;