Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: subprocess.cc

Issue 3723005: AU: Pass opened device fd from update engine to bspatch. (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: fix for review (StringPrintf()) Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « subprocess.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: subprocess.cc
diff --git a/subprocess.cc b/subprocess.cc
index 28b895c1211b730db8b30e95686efa56e6b4f1c3..49fc4c35c22e098413166310de5d8063b642a7e4 100755
--- a/subprocess.cc
+++ b/subprocess.cc
@@ -135,8 +135,9 @@ void Subprocess::CancelExec(uint32_t tag) {
}
}
-bool Subprocess::SynchronousExec(const std::vector<std::string>& cmd,
- int* return_code) {
+bool Subprocess::SynchronousExecFlags(const std::vector<std::string>& cmd,
+ int* return_code,
+ GSpawnFlags flags) {
GError* err = NULL;
scoped_array<char*> argv(new char*[cmd.size() + 1]);
for (unsigned int i = 0; i < cmd.size(); i++) {
@@ -157,16 +158,17 @@ bool Subprocess::SynchronousExec(const std::vector<std::string>& cmd,
char* child_stdout;
- bool success = g_spawn_sync(NULL, // working directory
- argv.get(),
- argp,
- G_SPAWN_STDERR_TO_DEV_NULL, // flags
- GRedirectStderrToStdout, // child setup function
- NULL, // data for child setup function
- &child_stdout,
- NULL,
- return_code,
- &err);
+ bool success = g_spawn_sync(
+ NULL, // working directory
+ argv.get(),
+ argp,
+ static_cast<GSpawnFlags>(G_SPAWN_STDERR_TO_DEV_NULL | flags), // flags
+ GRedirectStderrToStdout, // child setup function
+ NULL, // data for child setup function
+ &child_stdout,
+ NULL,
+ return_code,
+ &err);
FreeArgv(argv.get());
if (err)
LOG(INFO) << "err is: " << err->code << ", " << err->message;
« no previous file with comments | « subprocess.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698