Lots more verbiage in error messages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
diff --git a/main.c b/main.c
index b78761f..cd15a4f 100644
--- a/main.c
+++ b/main.c
@@ -3719,7 +3719,7 @@ static void fork_monitor()
int pfd[2];
int r = pipe(pfd);
if (r<0) {
- perror("pipe");
+ perror("pipe - failed to create pipe for --monitor");
exit(1);
}
@@ -3727,26 +3727,26 @@ static void fork_monitor()
fflush(stderr);
r = dup2(pfd[1], 2);
if (r<0) {
- perror("dup2");
+ perror("dup2 - failed to alias stderr to write end of pipe for --monitor");
exit(1);
}
r = close(pfd[1]);
if (r<0) {
- perror("close");
+ perror("close - failed to close write end of pipe for --monitor");
exit(1);
}
// Don't let a dying monitor kill the main process
sighandler_t sr = signal(SIGPIPE, SIG_IGN);
if (SIG_ERR==sr) {
- perror("signal");
+ perror("signal - failed to edit signal mask for --monitor");
exit(1);
}
// Fork a child process
r = fork();
if (r<0) {
- perror("fork");
+ perror("fork - failed to fork child process for --monitor");
exit(1);
}
@@ -3755,25 +3755,25 @@ static void fork_monitor()
// Make stdin read end of pipe
r = dup2(pfd[0], 0);
if (r<0) {
- perror("dup2");
+ perror("dup2 - in child, failed to alias read end of pipe to stdin for --monitor");
exit(1);
}
close(pfd[0]);
if (r<0) {
- perror("close");
+ perror("close - in child, failed to close read end of pipe for --monitor");
exit(1);
}
// Launch user specified command
execl("/bin/bash", "/bin/bash", "-c", opt_stderr_cmd, (char*)NULL);
- perror("execl");
+ perror("execl - in child failed to exec user specified command for --monitor");
exit(1);
}
// In parent, clean up unused fds
r = close(pfd[0]);
if (r<0) {
- perror("close");
+ perror("close - failed to close read end of pipe for --monitor");
exit(1);
}
}