ryantimwilson / rpms / systemd

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