summaryrefslogtreecommitdiff
path: root/src/update-utmp
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-10-04 23:01:32 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-10-04 16:01:32 +0200
commit4c701096002fff540d9ddb3b21398c551ac3af78 (patch)
tree537e654dc92baa5eed5b6ff69867114384ecfa47 /src/update-utmp
parent6d0aa4db7b33c9ce71b820c76428a1cfd24fb56f (diff)
downloadsystemd-4c701096002fff540d9ddb3b21398c551ac3af78.tar.gz
tree-wide: use IN_SET macro (#6977)
Diffstat (limited to 'src/update-utmp')
-rw-r--r--src/update-utmp/update-utmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c
index f68d60a134..679471e217 100644
--- a/src/update-utmp/update-utmp.c
+++ b/src/update-utmp/update-utmp.c
@@ -183,7 +183,7 @@ static int on_runlevel(Context *c) {
q = utmp_get_runlevel(&previous, NULL);
if (q < 0) {
- if (q != -ESRCH && q != -ENOENT)
+ if (!IN_SET(q, -ESRCH, -ENOENT))
return log_error_errno(q, "Failed to get current runlevel: %m");
previous = 0;
@@ -213,7 +213,7 @@ static int on_runlevel(Context *c) {
#endif
q = utmp_put_runlevel(runlevel, previous);
- if (q < 0 && q != -ESRCH && q != -ENOENT) {
+ if (q < 0 && !IN_SET(q, -ESRCH, -ENOENT)) {
log_error_errno(q, "Failed to write utmp record: %m");
r = q;
}
@@ -249,7 +249,7 @@ int main(int argc, char *argv[]) {
/* If the kernel lacks netlink or audit support,
* don't worry about it. */
c.audit_fd = audit_open();
- if (c.audit_fd < 0 && errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
+ if (c.audit_fd < 0 && !IN_SET(errno, EAFNOSUPPORT, EPROTONOSUPPORT))
log_error_errno(errno, "Failed to connect to audit log: %m");
#endif
r = bus_connect_system_systemd(&c.bus);