We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4192f95 commit e1b14e6Copy full SHA for e1b14e6
src/util.c
@@ -117,11 +117,17 @@ execute(const char *cmd_line, int quiet)
117
debug(LOG_DEBUG, "Waiting for PID %d to exit", pid);
118
rc = waitpid(pid, &status, 0);
119
debug(LOG_DEBUG, "Process PID %d exited", rc);
120
+
121
+ if (-1 == rc) {
122
+ debug(LOG_ERR, "waitpid() failed (%s)", strerror(errno));
123
+ return 1; /* waitpid failed. */
124
+ }
125
126
if (WIFEXITED(status)) {
127
return (WEXITSTATUS(status));
128
} else {
129
/* If we get here, child did not exit cleanly. Will return non-zero exit code to caller*/
130
+ debug(LOG_DEBUG, "Child may have been killed.");
131
return 1;
132
}
133
0 commit comments