Skip to content

Commit a196e22

Browse files
committed
Fix issue 24824 - ensure we exit a child that does not succeed in exec.
1 parent cd02612 commit a196e22

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

std/process.d

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4525,11 +4525,12 @@ else version (Posix)
45254525
if (childpid == 0)
45264526
{
45274527
// Trusted because args and all entries are always zero-terminated
4528-
(() @trusted =>
4529-
core.sys.posix.unistd.execvp(args[0], &args[0]) ||
4530-
perror(args[0]) // failed to execute
4531-
)();
4532-
return;
4528+
(() @trusted {
4529+
core.sys.posix.unistd.execvp(args[0], &args[0]);
4530+
perror(args[0]);
4531+
core.sys.posix.unistd._exit(1);
4532+
})();
4533+
assert(0, "Child failed to exec");
45334534
}
45344535
if (browser)
45354536
// Trusted because it's allocated via strdup above

0 commit comments

Comments
 (0)