Skip to content

Commit 4192f95

Browse files
committed
execute() now handles child that die, closes #175
1 parent 2d5f45f commit 4192f95

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ execute(const char *cmd_line, int quiet)
118118
rc = waitpid(pid, &status, 0);
119119
debug(LOG_DEBUG, "Process PID %d exited", rc);
120120

121-
return (WEXITSTATUS(status));
121+
if (WIFEXITED(status)) {
122+
return (WEXITSTATUS(status));
123+
} else {
124+
/* If we get here, child did not exit cleanly. Will return non-zero exit code to caller*/
125+
return 1;
126+
}
122127
}
123128

124129
struct in_addr *

0 commit comments

Comments
 (0)