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.
This commit is contained in:
Romain Vimont 2017-12-27 11:53:41 +01:00
parent 07b3918129
commit a919944372

View file

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