Skip to content

Commit 1708bee

Browse files
committed
Use _exit instead of exit if exec() fails after forking
* Otherwise if we call exit() it can ruin the parent process by calling atexit(), signal handlers, and other things.
1 parent 9878223 commit 1708bee

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

renderdoc/os/posix/posix_process.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,8 @@ static pid_t RunProcess(const char *app, const char *workingDir, const char *cmd
369369

370370
chdir(workDir.c_str());
371371
execve(appPath.c_str(), argv, envp);
372-
RDCERR("Failed to execute '%s' %s", appName.c_str(), strerror(errno));
373-
RDCERR("Full Path: '%s'", appPath.c_str());
374-
375-
exit(0);
372+
fprintf(stderr, "exec failed\n");
373+
_exit(1);
376374
}
377375
}
378376

0 commit comments

Comments
 (0)