diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2020-10-09 14:59:44 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2020-10-09 15:02:23 +0200 |
commit | d7a0f1f4f9910a1a2d290e31b2ba8cfa7126fbdd (patch) | |
tree | f519b20cb0835f71bd553abeca761882cad3299b /src/core | |
parent | coccinelle: introduce drop-braces transformation (diff) | |
download | systemd-d7a0f1f4f9910a1a2d290e31b2ba8cfa7126fbdd.tar.xz systemd-d7a0f1f4f9910a1a2d290e31b2ba8cfa7126fbdd.zip |
tree-wide: assorted coccinelle fixes
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dbus-cgroup.c | 6 | ||||
-rw-r--r-- | src/core/main.c | 4 | ||||
-rw-r--r-- | src/core/selinux-setup.c | 7 | ||||
-rw-r--r-- | src/core/service.c | 2 |
4 files changed, 8 insertions, 11 deletions
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c index b7d2e32639..9fdd3d83ca 100644 --- a/src/core/dbus-cgroup.c +++ b/src/core/dbus-cgroup.c @@ -1500,9 +1500,9 @@ int bus_cgroup_set_property( LIST_PREPEND(device_allow, c->device_allow, a); } - a->r = !!strchr(rwm, 'r'); - a->w = !!strchr(rwm, 'w'); - a->m = !!strchr(rwm, 'm'); + a->r = strchr(rwm, 'r'); + a->w = strchr(rwm, 'w'); + a->m = strchr(rwm, 'm'); } n++; diff --git a/src/core/main.c b/src/core/main.c index f957217eaa..08504961a2 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1064,13 +1064,11 @@ static int parse_argv(int argc, char *argv[]) { assert_not_reached("Unhandled option code."); } - if (optind < argc && getpid_cached() != 1) { + if (optind < argc && getpid_cached() != 1) /* Hmm, when we aren't run as init system * let's complain about excess arguments */ - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Excess arguments."); - } return 0; } diff --git a/src/core/selinux-setup.c b/src/core/selinux-setup.c index 40da8dd0e5..8c67352ddb 100644 --- a/src/core/selinux-setup.c +++ b/src/core/selinux-setup.c @@ -96,10 +96,9 @@ int mac_selinux_setup(bool *loaded_policy) { log_open(); if (enforce > 0) { - if (!initialized) { - log_emergency("Failed to load SELinux policy."); - return -EIO; - } + if (!initialized) + return log_emergency_errno(SYNTHETIC_ERRNO(EIO), + "Failed to load SELinux policy."); log_warning("Failed to load new SELinux policy. Continuing with old policy."); } else diff --git a/src/core/service.c b/src/core/service.c index 863b6755b1..d23384c475 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -4201,7 +4201,7 @@ static void service_bus_name_owner_change(Unit *u, const char *new_owner) { else log_unit_debug(u, "D-Bus name %s now not owned by anyone.", s->bus_name); - s->bus_name_good = !!new_owner; + s->bus_name_good = new_owner; /* Track the current owner, so we can reconstruct changes after a daemon reload */ r = free_and_strdup(&s->bus_name_owner, new_owner); |