tree-wide: assorted coccinelle fixes

This commit is contained in:
Frantisek Sumsal
2020-10-09 15:02:23 +02:00
parent 44e66de0f2
commit d7a0f1f4f9
56 changed files with 351 additions and 399 deletions
+3 -3
View File
@@ -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++;
+1 -3
View File
@@ -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;
}
+3 -4
View File
@@ -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
+1 -1
View File
@@ -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);