summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-02-19 01:55:28 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-02-19 12:17:52 +0900
commit65cd9c7251384f7af934f8d928118b2d4829ee6c (patch)
tree4114438912b40b802ad19947a36d8fe4036c2ff5 /src
parentb9fadf2e2cb83d342342341b0edba4f519890634 (diff)
downloadsystemd-65cd9c7251384f7af934f8d928118b2d4829ee6c.tar.gz
exec-util: propagate error in wait_for_terminate_and_check()
Then, the two error handlings becomes consistent with the one in execute_directories().
Diffstat (limited to 'src')
-rw-r--r--src/shared/exec-util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shared/exec-util.c b/src/shared/exec-util.c
index 7ed2cce76b..51234fd025 100644
--- a/src/shared/exec-util.c
+++ b/src/shared/exec-util.c
@@ -151,10 +151,9 @@ static int do_execute(
t = NULL;
} else {
r = wait_for_terminate_and_check(t, pid, WAIT_LOG);
- if (FLAGS_SET(flags, EXEC_DIR_IGNORE_ERRORS)) {
- if (r < 0)
- continue;
- } else if (r > 0)
+ if (r < 0)
+ return r;
+ if (!FLAGS_SET(flags, EXEC_DIR_IGNORE_ERRORS) && r > 0)
return r;
if (callbacks) {
@@ -186,6 +185,8 @@ static int do_execute(
assert(t);
r = wait_for_terminate_and_check(t, pid, WAIT_LOG);
+ if (r < 0)
+ return r;
if (!FLAGS_SET(flags, EXEC_DIR_IGNORE_ERRORS) && r > 0)
return r;
}