X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Frun%2Frun.c;h=85eb052343a5d73b2d8d2958aa12aa83bb7fc13d;hb=22d097a6bbeac0d45c42e1b246403a97e9a16c30;hp=d61f8db35096abaa1ccc055ece85b1caa9251cc9;hpb=56f64d95763a799ba4475daf44d8e9f72a1bd474;p=elogind.git diff --git a/src/run/run.c b/src/run/run.c index d61f8db35..85eb05234 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);