chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TODO
[elogind.git]
/
src
/
update-utmp.c
diff --git
a/src/update-utmp.c
b/src/update-utmp.c
index f81e7f495f864c25949c2bafdbec0878b32ae34d..0d177d61645d56f7ebd37ff8e78349cf2818bd2b 100644
(file)
--- a/
src/update-utmp.c
+++ b/
src/update-utmp.c
@@
-284,7
+284,7
@@
static int on_shutdown(Context *c) {
}
#endif
}
#endif
- if ((q = utmp_put_shutdown(
0
)) < 0) {
+ if ((q = utmp_put_shutdown()) < 0) {
log_error("Failed to write utmp record: %s", strerror(-q));
r = q;
}
log_error("Failed to write utmp record: %s", strerror(-q));
r = q;
}
@@
-339,7
+339,7
@@
static int on_runlevel(Context *c) {
}
#endif
}
#endif
- if ((q = utmp_put_runlevel(
0,
runlevel, previous)) < 0) {
+ if ((q = utmp_put_runlevel(runlevel, previous)) < 0) {
log_error("Failed to write utmp record: %s", strerror(-q));
r = q;
}
log_error("Failed to write utmp record: %s", strerror(-q));
r = q;
}
@@
-369,14
+369,17
@@
int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
- log_set_target(LOG_TARGET_
SYSLOG_OR_KMSG
);
+ log_set_target(LOG_TARGET_
AUTO
);
log_parse_environment();
log_open();
umask(0022);
#ifdef HAVE_AUDIT
log_parse_environment();
log_open();
umask(0022);
#ifdef HAVE_AUDIT
- if ((c.audit_fd = audit_open()) < 0)
+ if ((c.audit_fd = audit_open()) < 0 &&
+ /* If the kernel lacks netlink or audit support,
+ * don't worry about it. */
+ errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
log_error("Failed to connect to audit log: %m");
#endif
log_error("Failed to connect to audit log: %m");
#endif