summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/execute.c3
-rw-r--r--src/core/main.c3
-rw-r--r--src/core/namespace.c15
-rw-r--r--src/core/service.c7
4 files changed, 11 insertions, 17 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index cd3592b847..6abb0a5d5d 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1998,9 +1998,8 @@ void exec_context_done(ExecContext *c) {
strv_free(c->environment_files);
c->environment_files = NULL;
- for (l = 0; l < ELEMENTSOF(c->rlimit); l++) {
+ for (l = 0; l < ELEMENTSOF(c->rlimit); l++)
c->rlimit[l] = mfree(c->rlimit[l]);
- }
c->working_directory = mfree(c->working_directory);
c->root_directory = mfree(c->root_directory);
diff --git a/src/core/main.c b/src/core/main.c
index be7d41907a..48b5057a85 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1842,9 +1842,8 @@ finish:
arg_shutdown_watchdog = m->shutdown_watchdog;
m = manager_free(m);
- for (j = 0; j < ELEMENTSOF(arg_default_rlimit); j++) {
+ for (j = 0; j < ELEMENTSOF(arg_default_rlimit); j++)
arg_default_rlimit[j] = mfree(arg_default_rlimit[j]);
- }
arg_default_unit = mfree(arg_default_unit);
diff --git a/src/core/namespace.c b/src/core/namespace.c
index 0b85b859fa..eb88574f8f 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -294,15 +294,15 @@ static int mount_kdbus(BindMount *m) {
busnode = strjoina(root, "/bus");
if (mknod(busnode, (st.st_mode & ~07777) | 0600, st.st_rdev) < 0) {
- log_error_errno(errno, "mknod() for %s failed: %m", busnode);
- r = -errno;
+ r = log_error_errno(errno, "mknod() for %s failed: %m",
+ busnode);
goto fail;
}
r = mount(m->path, busnode, NULL, MS_BIND, NULL);
if (r < 0) {
- log_error_errno(errno, "bind mount of %s failed: %m", m->path);
- r = -errno;
+ r = log_error_errno(errno, "bind mount of %s failed: %m",
+ m->path);
goto fail;
}
@@ -313,8 +313,8 @@ static int mount_kdbus(BindMount *m) {
}
if (mount(root, basepath, NULL, MS_MOVE, NULL) < 0) {
- log_error_errno(errno, "bind mount of %s failed: %m", basepath);
- r = -errno;
+ r = log_error_errno(errno, "bind mount of %s failed: %m",
+ basepath);
goto fail;
}
@@ -555,10 +555,9 @@ int setup_namespace(
/* Remount / as the desired mode. Not that this will not
* reestablish propagation from our side to the host, since
* what's disconnected is disconnected. */
- if (mount(NULL, "/", NULL, mount_flags | MS_REC, NULL) < 0) {
+ if (mount(NULL, "/", NULL, mount_flags | MS_REC, NULL) < 0)
/* at this point, we cannot rollback */
return -errno;
- }
return 0;
diff --git a/src/core/service.c b/src/core/service.c
index e396dbe213..248a9e8c62 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2937,14 +2937,11 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
}
/* Interpret WATCHDOG= */
- if (strv_find(tags, "WATCHDOG=1")) {
+ if (strv_find(tags, "WATCHDOG=1"))
service_reset_watchdog(s);
- }
- /* Add the passed fds to the fd store */
- if (strv_find(tags, "FDSTORE=1")) {
+ if (strv_find(tags, "FDSTORE=1"))
service_add_fd_store_set(s, fds);
- }
/* Notify clients about changed status or main pid */
if (notify_dbus)