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:
parent
07b3918129
commit
a919944372
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue