From 3ed5eb3dcf7a760efa2b4bceaf04d1789960935b Mon Sep 17 00:00:00 2001 From: Wolfgang Lux Date: Mon, 9 Oct 2023 22:51:01 +0200 Subject: [PATCH] Use _exit instead of exit to terminate a vfork'ed process. This avoids running the atexit handlers, which could have visible side effects in the parent process. --- ChangeLog | 7 +++++++ Source/NSTask.m | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39a2a8ecf..239d9d5cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-10-09 Wolfgang Lux + + * 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 * Source/NSPredicate.m: fixup for array access keywords diff --git a/Source/NSTask.m b/Source/NSTask.m index cc43df9c5..94c494d8f 100644 --- a/Source/NSTask.m +++ b/Source/NSTask.m @@ -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 {