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

This commit is contained in:
Josh Gao 2018-03-29 20:19:27 +00:00 committed by Gerrit Code Review
commit 31ed2a5c04

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());
}