Use _exit instead of exit after exec fails
A call to exit() will run the atexit handlers before exiting, which is
usually not desirable in a forked-off child process.
Calling _exit() instead will not run the atexit handlers.
Change-Id: Ide9a69c0468faafeaf32b0babd9fcf2b4f06f546
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 48dce63..68db7e3 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -1434,7 +1434,8 @@
execv(program, &args[0]);
PLOG(ERROR) << "Failed to execv(" << command_line << ")";
- exit(1);
+ // _exit to avoid atexit handlers in child.
+ _exit(1);
} else {
if (pid == -1) {
*error_msg = StringPrintf("Failed to execv(%s) because fork failed: %s",