1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

exec-invoke: handle errno log message writing in write_confirm_error_fd() like we usually do

This commit is contained in:
Lennart Poettering 2024-07-11 11:44:31 +02:00
parent 83e5672f90
commit 85f3957072

View File

@ -694,15 +694,16 @@ static int setup_confirm_stdio(
} }
static void write_confirm_error_fd(int err, int fd, const char *unit_id) { 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); 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); dprintf(fd, "Confirmation question timed out for %s, assuming positive response.\n", unit_id);
else { else
errno = -err; dprintf(fd, "Couldn't ask confirmation for %s, assuming positive response: %m\n", unit_id);
dprintf(fd, "Couldn't ask confirmation for %s: %m, assuming positive response.\n", unit_id);
}
} }
static void write_confirm_error(int err, const char *vc, const char *unit_id) { static void write_confirm_error(int err, const char *vc, const char *unit_id) {