The bluetooth hack I98a1c8aedfa042b1824de7d8c69f2600c9bfcf29 uses the
wrong exit() after the exec() fail.
This will have undesirable effects like cpp destructors and atexit() funcs
being invoked which could have undesirable effects for the parent.
Also fixed other prior instance of fork()+exec()+"return"
Change-Id: I8c09472a371640a710c55fc18e020b9c152bf9cc
ALOGE("execl failed (%s)", strerror(errno));
}
ALOGE("Should never get here!");
- free(args);
- return 0;
+ _exit(-1);
} else {
close(pipefd[0]);
mDaemonPid = pid;
// TODO(BT) inform parent of the failure.
// Parent process need wait for child to report error status
// before it set mDhcpcdPid and return 0.
- exit(-1);
+ _exit(-1);
} else {
mDhcpcdPid = pid;
ALOGD("Reverse Tethering running, pid:%d", pid);