chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build-sys: support setting path and service names from configure
[elogind.git]
/
utmp-wtmp.c
diff --git
a/utmp-wtmp.c
b/utmp-wtmp.c
index 1650d10eba753cd7a8c065ff32ed1e07489e7ded..cb3f201322edbef648ca68b7bf5cb8933d231711 100644
(file)
--- a/
utmp-wtmp.c
+++ b/
utmp-wtmp.c
@@
-179,7
+179,7
@@
int utmp_put_reboot(usec_t timestamp) {
init_entry(&store, timestamp);
store.ut_type = BOOT_TIME;
init_entry(&store, timestamp);
store.ut_type = BOOT_TIME;
- strncpy(store.ut_user, "reboot", sizeof(store.ut_
type
));
+ strncpy(store.ut_user, "reboot", sizeof(store.ut_
user
));
return write_entry_both(&store);
}
return write_entry_both(&store);
}
@@
-193,8
+193,12
@@
int utmp_put_runlevel(usec_t timestamp, int runlevel, int previous) {
if (previous <= 0) {
/* Find the old runlevel automatically */
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;
if (previous == runlevel)
return 0;