Merge "adbd: spawn login shell when run without a command."

am: 31ed2a5c04

Change-Id: I133b09a0a153cb660186126106bceca76b0cba24
This commit is contained in:
Josh Gao 2018-03-29 20:35:27 +00:00 committed by android-build-merger
commit a7a66f40fd
1 changed files with 2 additions and 1 deletions

View File

@ -344,7 +344,8 @@ bool Subprocess::ForkAndExec(std::string* error) {
}
if (command_.empty()) {
execle(_PATH_BSHELL, _PATH_BSHELL, "-", nullptr, cenv.data());
// Spawn a login shell if we don't have a command.
execle(_PATH_BSHELL, "-" _PATH_BSHELL, nullptr, cenv.data());
} else {
execle(_PATH_BSHELL, _PATH_BSHELL, "-c", command_.c_str(), nullptr, cenv.data());
}