Skip to content

Commit

Permalink
Use _exit instead of exit to terminate a vfork'ed process.
Browse files Browse the repository at this point in the history
This avoids running the atexit handlers, which could have visible side
effects in the parent process.
  • Loading branch information
wlux committed Oct 9, 2023
1 parent 5121156 commit 3ed5eb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2023-10-09 Wolfgang Lux <[email protected]>

* Source/NSTask.m(launchAndReturnError:): Use _exit instead of
exit to terminate the vfork'ed process. This avoids running the
atexit handlers, which could have visible side effects in the
parent process.

2023-10-08 Richard Frith-Macdonald <[email protected]>

* Source/NSPredicate.m: fixup for array access keywords
Expand Down
4 changes: 2 additions & 2 deletions Source/NSTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -1735,11 +1735,11 @@ - (BOOL) launchAndReturnError: (NSError **)error

if (0 != chdir(path))
{
exit(-1);
_exit(-1);
}

(void)execve(executable, (char**)args, (char**)envl);
exit(-1);
_exit(-1);
}
else
{
Expand Down

0 comments on commit 3ed5eb3

Please sign in to comment.