Skip to content

Commit ed439a1

Browse files
committed
*-daemon: properly log ready fd error
1 parent b1e3e6c commit ed439a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/start-stop-daemon/start-stop-daemon.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,10 @@ int main(int argc, char **argv)
11181118
cloexec_fds_from(3);
11191119

11201120
if (notify.type == NOTIFY_FD) {
1121-
if (close(notify.pipe[0]) == -1 || dup2(notify.pipe[1], notify.fd) == -1)
1122-
eerrorx("Failed to initialize notify fd.");
1121+
if (close(notify.pipe[0]) == -1)
1122+
eerrorx("%s: failed to close notify pipe[0]: %s", applet, strerror(errno));
1123+
if (dup2(notify.pipe[1], notify.fd) == -1)
1124+
eerrorx("%s: failed to initialize notify fd: %s", applet, strerror(errno));
11231125
}
11241126

11251127
if (scheduler != NULL) {

src/supervise-daemon/supervise-daemon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ RC_NORETURN static void child_process(char *exec, char **argv)
597597
cloexec_fds_from(3);
598598

599599
if (notify.type == NOTIFY_FD && dup2(notify.pipe[1], notify.fd) == -1)
600-
eerrorx("Failed to initialize ready fd.");
600+
eerrorx("%s: failed to dup ready fd: %s", applet, strerror(errno));
601601

602602
cmdline = make_cmdline(argv);
603603
syslog(LOG_INFO, "Child command line: %s", cmdline);

0 commit comments

Comments
 (0)