From 1708bee968063206990fa310d5dff897499d9381 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 2 Aug 2017 15:30:33 +0100 Subject: [PATCH] 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. --- renderdoc/os/posix/posix_process.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/renderdoc/os/posix/posix_process.cpp b/renderdoc/os/posix/posix_process.cpp index 492292cef..774b871a0 100644 --- a/renderdoc/os/posix/posix_process.cpp +++ b/renderdoc/os/posix/posix_process.cpp @@ -369,10 +369,8 @@ static pid_t RunProcess(const char *app, const char *workingDir, const char *cmd chdir(workDir.c_str()); execve(appPath.c_str(), argv, envp); - RDCERR("Failed to execute '%s' %s", appName.c_str(), strerror(errno)); - RDCERR("Full Path: '%s'", appPath.c_str()); - - exit(0); + fprintf(stderr, "exec failed\n"); + _exit(1); } }