summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 18:50:43 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 18:56:16 +0100
commitf647962d64e844689f3e2acfce6102fc47e76df2 (patch)
treedcaf5e38de1d4e31f73f540bc85532ceb72cfa6b /src/run
parente80733be33e52d8ab2f1ae845326d39c600f5612 (diff)
treewide: yet more log_*_errno + return simplifications
Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/run/run.c b/src/run/run.c
index 8c7bd5c92d..b96517a99a 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -498,10 +498,8 @@ static int start_transient_scope(
gid_t gid;
r = get_group_creds(&arg_exec_group, &gid);
- if (r < 0) {
- log_error_errno(r, "Failed to resolve group %s: %m", arg_exec_group);
- return r;
- }
+ 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("Failed to change GID to " GID_FMT ": %m", gid);
@@ -515,10 +513,8 @@ static int start_transient_scope(
gid_t gid;
r = get_user_creds(&arg_exec_user, &uid, &gid, &home, &shell);
- if (r < 0) {
- log_error_errno(r, "Failed to resolve user %s: %m", arg_exec_user);
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to resolve user %s: %m", arg_exec_user);
r = strv_extendf(&user_env, "HOME=%s", home);
if (r < 0)