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

Side by Side Diff: chrome/browser/chromeos/process_proxy/process_proxy.cc

Issue 12223118: When launching crosh process set TERM var to be 'xterm' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/process_proxy/process_proxy.h" 5 #include "chrome/browser/chromeos/process_proxy/process_proxy.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <sys/ioctl.h> 9 #include <sys/ioctl.h>
10 10
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 pid_t* pid) { 209 pid_t* pid) {
210 // Redirect crosh process' output and input so we can read it. 210 // Redirect crosh process' output and input so we can read it.
211 base::FileHandleMappingVector fds_mapping; 211 base::FileHandleMappingVector fds_mapping;
212 fds_mapping.push_back(std::make_pair(slave_fd, STDIN_FILENO)); 212 fds_mapping.push_back(std::make_pair(slave_fd, STDIN_FILENO));
213 fds_mapping.push_back(std::make_pair(slave_fd, STDOUT_FILENO)); 213 fds_mapping.push_back(std::make_pair(slave_fd, STDOUT_FILENO));
214 fds_mapping.push_back(std::make_pair(slave_fd, STDERR_FILENO)); 214 fds_mapping.push_back(std::make_pair(slave_fd, STDERR_FILENO));
215 base::LaunchOptions options; 215 base::LaunchOptions options;
216 options.fds_to_remap = &fds_mapping; 216 options.fds_to_remap = &fds_mapping;
217 options.ctrl_terminal_fd = slave_fd; 217 options.ctrl_terminal_fd = slave_fd;
218 218
219 base::EnvironmentVector environ;
220 environ.push_back(std::make_pair("TERM", "xterm"));
221 options.environ = &environ;
222
219 // Launch the process. 223 // Launch the process.
220 return base::LaunchProcess(CommandLine(base::FilePath(command)), options, 224 return base::LaunchProcess(CommandLine(base::FilePath(command)), options,
221 pid); 225 pid);
222 } 226 }
223 227
224 void ProcessProxy::CloseAllFdPairs() { 228 void ProcessProxy::CloseAllFdPairs() {
225 CloseFdPair(pt_pair_); 229 CloseFdPair(pt_pair_);
226 CloseFdPair(shutdown_pipe_); 230 CloseFdPair(shutdown_pipe_);
227 } 231 }
228 232
(...skipping 12 matching lines...) Expand all
241 245
242 void ProcessProxy::ClearAllFdPairs() { 246 void ProcessProxy::ClearAllFdPairs() {
243 ClearFdPair(pt_pair_); 247 ClearFdPair(pt_pair_);
244 ClearFdPair(shutdown_pipe_); 248 ClearFdPair(shutdown_pipe_);
245 } 249 }
246 250
247 void ProcessProxy::ClearFdPair(int* pipe) { 251 void ProcessProxy::ClearFdPair(int* pipe) {
248 pipe[PIPE_END_READ] = kInvalidFd; 252 pipe[PIPE_END_READ] = kInvalidFd;
249 pipe[PIPE_END_WRITE] = kInvalidFd; 253 pipe[PIPE_END_WRITE] = kInvalidFd;
250 } 254 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698