Merge "init: set $PATH in second stage init" am: d1bd5f20eb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1372196 Change-Id: Iaf32e1bb1f62d0fd799f19fd26b7160e08d152c6
This commit is contained in:
commit
7ff4055bfc
1 changed files with 7 additions and 0 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <paths.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
@ -727,6 +728,12 @@ int SecondStageMain(int argc, char** argv) {
|
||||||
InitSecondStageLogging(argv);
|
InitSecondStageLogging(argv);
|
||||||
LOG(INFO) << "init second stage started!";
|
LOG(INFO) << "init second stage started!";
|
||||||
|
|
||||||
|
// Update $PATH in the case the second stage init is newer than first stage init, where it is
|
||||||
|
// first set.
|
||||||
|
if (setenv("PATH", _PATH_DEFPATH, 1) != 0) {
|
||||||
|
PLOG(FATAL) << "Could not set $PATH to '" << _PATH_DEFPATH << "' in second stage";
|
||||||
|
}
|
||||||
|
|
||||||
// Init should not crash because of a dependence on any other process, therefore we ignore
|
// Init should not crash because of a dependence on any other process, therefore we ignore
|
||||||
// SIGPIPE and handle EPIPE at the call site directly. Note that setting a signal to SIG_IGN
|
// SIGPIPE and handle EPIPE at the call site directly. Note that setting a signal to SIG_IGN
|
||||||
// is inherited across exec, but custom signal handlers are not. Since we do not want to
|
// is inherited across exec, but custom signal handlers are not. Since we do not want to
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue