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