summaryrefslogtreecommitdiff
path: root/src/update-utmp/update-utmp.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-09-13 10:51:30 -0400
committerLennart Poettering <lennart@poettering.net>2012-09-13 17:17:32 +0200
commit55f2dca329afd0dcdc4793ce3e945cb8af653937 (patch)
treef0235aedb245a79d35740717efbacbbe725da63a /src/update-utmp/update-utmp.c
parenta1cccad1fe88ddd6943e18af97cf7f466296970f (diff)
update-utmp: Don't error out on runlevel updates if utmp doesn't exist
Other parts of the code handle utmp not existing, so let's be consistent. At the moment my GNOME-OSTree builds don't have utmp.
Diffstat (limited to 'src/update-utmp/update-utmp.c')
-rw-r--r--src/update-utmp/update-utmp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c
index fceeed8b44..67c5788fe7 100644
--- a/src/update-utmp/update-utmp.c
+++ b/src/update-utmp/update-utmp.c
@@ -301,8 +301,10 @@ static int on_runlevel(Context *c) {
#endif
if ((q = utmp_put_runlevel(runlevel, previous)) < 0) {
- log_error("Failed to write utmp record: %s", strerror(-q));
- r = q;
+ if (q != -ESRCH && q != -ENOENT) {
+ log_error("Failed to write utmp record: %s", strerror(-q));
+ r = q;
+ }
}
return r;