From 4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 28 Nov 2014 19:57:32 +0100 Subject: treewide: another round of simplifications Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". --- src/run/run.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/run/run.c') diff --git a/src/run/run.c b/src/run/run.c index d61f8db350..85eb052343 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -488,10 +488,8 @@ static int start_transient_scope( return bus_log_create_error(r); if (arg_nice_set) { - if (setpriority(PRIO_PROCESS, 0, arg_nice) < 0) { - log_error_errno(errno, "Failed to set nice level: %m"); - return -errno; - } + if (setpriority(PRIO_PROCESS, 0, arg_nice) < 0) + return log_error_errno(errno, "Failed to set nice level: %m"); } if (arg_exec_group) { @@ -501,10 +499,8 @@ static int start_transient_scope( if (r < 0) return log_error_errno(r, "Failed to resolve group %s: %m", arg_exec_group); - if (setresgid(gid, gid, gid) < 0) { - log_error_errno(errno, "Failed to change GID to " GID_FMT ": %m", gid); - return -errno; - } + if (setresgid(gid, gid, gid) < 0) + return log_error_errno(errno, "Failed to change GID to " GID_FMT ": %m", gid); } if (arg_exec_user) { @@ -533,16 +529,12 @@ static int start_transient_scope( return log_oom(); if (!arg_exec_group) { - if (setresgid(gid, gid, gid) < 0) { - log_error_errno(errno, "Failed to change GID to " GID_FMT ": %m", gid); - return -errno; - } + if (setresgid(gid, gid, gid) < 0) + return log_error_errno(errno, "Failed to change GID to " GID_FMT ": %m", gid); } - if (setresuid(uid, uid, uid) < 0) { - log_error_errno(errno, "Failed to change UID to " UID_FMT ": %m", uid); - return -errno; - } + if (setresuid(uid, uid, uid) < 0) + return log_error_errno(errno, "Failed to change UID to " UID_FMT ": %m", uid); } env = strv_env_merge(3, environ, user_env, arg_environment); -- cgit v1.2.3-54-g00ecf