Fix linux launching of adb server

This commit is contained in:
baldurk
2019-05-02 13:29:20 +01:00
parent 225e34c592
commit c515065dcf
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -344,7 +344,8 @@ void initAdb()
Process::ProcessResult res = {};
Process::LaunchProcess(adb.c_str(), workdir.c_str(), "start-server", true, &res);
if(res.strStdout.find("daemon") != std::string::npos)
if(res.strStdout.find("daemon") != std::string::npos ||
res.strStderror.find("daemon") != std::string::npos)
{
RDCLOG("Started adb server");
}
+5 -1
View File
@@ -579,9 +579,13 @@ static pid_t RunProcess(const char *app, const char *workingDir, const char *cmd
dup2(stdoutPipe[1], STDOUT_FILENO);
dup2(stderrPipe[1], STDERR_FILENO);
// Close read ends, as the child will write.
// now close all pipe handles - we don't need the read ends, and the write ends have been
// duplicated into stdout/stderr above - we don't want these handles to be inherited into
// child processes.
close(stdoutPipe[0]);
close(stderrPipe[0]);
close(stdoutPipe[1]);
close(stderrPipe[1]);
}
chdir(workDir.c_str());