naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
b9a53a
From 81ca39b7b38ef1d44cc146efe75bef412e7c4c97 Mon Sep 17 00:00:00 2001
b9a53a
From: Lennart Poettering <lennart@poettering.net>
b9a53a
Date: Thu, 14 Mar 2019 17:01:46 +0100
b9a53a
Subject: [PATCH] execute: remove one redundant comparison check
b9a53a
b9a53a
(cherry picked from commit d484580ca6f0e79abe6f3f5c677323a22d9e22d7)
b9a53a
b9a53a
Related: #1778384
b9a53a
---
b9a53a
 src/core/execute.c | 7 ++++---
b9a53a
 1 file changed, 4 insertions(+), 3 deletions(-)
b9a53a
b9a53a
diff --git a/src/core/execute.c b/src/core/execute.c
b9a53a
index 9ddba00421..46aa733937 100644
b9a53a
--- a/src/core/execute.c
b9a53a
+++ b/src/core/execute.c
b9a53a
@@ -2097,11 +2097,12 @@ static int setup_exec_directory(
b9a53a
                         }
b9a53a
                 } else {
b9a53a
                         r = mkdir_label(p, context->directories[type].mode);
b9a53a
-                        if (r < 0 && r != -EEXIST)
b9a53a
-                                goto fail;
b9a53a
-                        if (r == -EEXIST) {
b9a53a
+                        if (r < 0) {
b9a53a
                                 struct stat st;
b9a53a
 
b9a53a
+                                if (r != -EEXIST)
b9a53a
+                                        goto fail;
b9a53a
+
b9a53a
                                 if (stat(p, &st) < 0) {
b9a53a
                                         r = -errno;
b9a53a
                                         goto fail;