Use _exit() instead of exit() in child process

exit() should not be called from within a child process, since it would
call functions registered with atexit(), and flush stdio streams. Use
_exit() instead.
master
Romain Vimont 8 years ago
parent 07b3918129
commit a919944372

@ -14,7 +14,7 @@ pid_t cmd_execute(const char *path, const char *const argv[]) {
if (pid == 0) { if (pid == 0) {
execvp(path, (char *const *)argv); execvp(path, (char *const *)argv);
perror("exec"); perror("exec");
exit(1); _exit(1);
} }
return pid; return pid;
} }

Loading…
Cancel
Save