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

Unified Diff: base/process_util_linux.cc

Issue 159112: Set GTK_PATH to CHROMIUM_SAVED_GTK_PATH before launching xdg-open.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « base/process_util.h ('k') | chrome/common/platform_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_linux.cc
===================================================================
--- base/process_util_linux.cc (revision 21122)
+++ base/process_util_linux.cc (working copy)
@@ -7,11 +7,12 @@
#include <ctype.h>
#include <dirent.h>
#include <fcntl.h>
-#include <string>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
+#include <string>
+
#include "base/eintr_wrapper.h"
#include "base/file_util.h"
#include "base/logging.h"
@@ -86,6 +87,7 @@
}
bool LaunchApp(const std::vector<std::string>& argv,
+ const environment_vector& environ,
const file_handle_mapping_vector& fds_to_remap,
bool wait, ProcessHandle* process_handle) {
pid_t pid = fork();
@@ -93,12 +95,24 @@
return false;
if (pid == 0) {
+ // Child process
InjectiveMultimap fd_shuffle;
for (file_handle_mapping_vector::const_iterator
it = fds_to_remap.begin(); it != fds_to_remap.end(); ++it) {
fd_shuffle.push_back(InjectionArc(it->first, it->second, false));
}
+ for (environment_vector::const_iterator it = environ.begin();
+ it != environ.end(); ++it) {
+ if (it->first) {
+ if (it->second) {
+ setenv(it->first, it->second, 1);
+ } else {
+ unsetenv(it->first);
+ }
+ }
+ }
+
if (!ShuffleFileDescriptors(fd_shuffle))
exit(127);
@@ -118,6 +132,7 @@
<< ", errno " << errno;
exit(127);
} else {
+ // Parent process
if (wait)
HANDLE_EINTR(waitpid(pid, 0, 0));
@@ -128,6 +143,13 @@
return true;
}
+bool LaunchApp(const std::vector<std::string>& argv,
+ const file_handle_mapping_vector& fds_to_remap,
+ bool wait, ProcessHandle* process_handle) {
+ base::environment_vector no_env;
+ return LaunchApp(argv, no_env, fds_to_remap, wait, process_handle);
+}
+
bool LaunchApp(const CommandLine& cl,
bool wait, bool start_hidden,
ProcessHandle* process_handle) {
« no previous file with comments | « base/process_util.h ('k') | chrome/common/platform_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698