summaryrefslogtreecommitdiffstats
path: root/src/core/exec-invoke.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/exec-invoke.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c
index 5a47c336c0..7d8270bc1c 100644
--- a/src/core/exec-invoke.c
+++ b/src/core/exec-invoke.c
@@ -694,15 +694,16 @@ static int setup_confirm_stdio(
}
static void write_confirm_error_fd(int err, int fd, const char *unit_id) {
- assert(err < 0);
+ assert(err != 0);
+ assert(fd >= 0);
assert(unit_id);
- if (err == -ETIMEDOUT)
+ errno = abs(err);
+
+ if (errno == ETIMEDOUT)
dprintf(fd, "Confirmation question timed out for %s, assuming positive response.\n", unit_id);
- else {
- errno = -err;
- dprintf(fd, "Couldn't ask confirmation for %s: %m, assuming positive response.\n", unit_id);
- }
+ else
+ dprintf(fd, "Couldn't ask confirmation for %s, assuming positive response: %m\n", unit_id);
}
static void write_confirm_error(int err, const char *vc, const char *unit_id) {