summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:57:32 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:57:32 +0100
commit4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f (patch)
treec7a6228e7151aa74bc8e331694a1e795226550cd /src/run
parent56f64d95763a799ba4475daf44d8e9f72a1bd474 (diff)
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c24
1 files changed, 8 insertions, 16 deletions
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);