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

Side by Side Diff: base/process/process_posix.cc

Issue 1086363003: Handled nullptr argument in WaitForExit() and WaitForExitWithTimeout() methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments incorporated. Created 5 years, 7 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
« no previous file with comments | « base/process/process.h ('k') | base/process/process_win.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/process/process.h" 5 #include "base/process/process.h"
6 6
7 #include <sys/resource.h> 7 #include <sys/resource.h>
8 #include <sys/wait.h> 8 #include <sys/wait.h>
9 9
10 #include "base/files/scoped_file.h" 10 #include "base/files/scoped_file.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 #else 186 #else
187 // Currently on Linux we can't handle non child processes. 187 // Currently on Linux we can't handle non child processes.
188 NOTIMPLEMENTED(); 188 NOTIMPLEMENTED();
189 #endif // OS_MACOSX 189 #endif // OS_MACOSX
190 } 190 }
191 191
192 int status; 192 int status;
193 if (!WaitpidWithTimeout(handle, &status, timeout)) 193 if (!WaitpidWithTimeout(handle, &status, timeout))
194 return false; 194 return false;
195 if (WIFSIGNALED(status)) { 195 if (WIFSIGNALED(status)) {
196 *exit_code = -1; 196 if (exit_code)
197 *exit_code = -1;
197 return true; 198 return true;
198 } 199 }
199 if (WIFEXITED(status)) { 200 if (WIFEXITED(status)) {
200 *exit_code = WEXITSTATUS(status); 201 if (exit_code)
202 *exit_code = WEXITSTATUS(status);
201 return true; 203 return true;
202 } 204 }
203 return false; 205 return false;
204 } 206 }
205 #endif // !defined(OS_NACL_NONSFI) 207 #endif // !defined(OS_NACL_NONSFI)
206 208
207 } // namespace 209 } // namespace
208 210
209 namespace base { 211 namespace base {
210 212
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 return false; 370 return false;
369 } 371 }
370 #endif // !defined(OS_LINUX) 372 #endif // !defined(OS_LINUX)
371 373
372 int Process::GetPriority() const { 374 int Process::GetPriority() const {
373 DCHECK(IsValid()); 375 DCHECK(IsValid());
374 return getpriority(PRIO_PROCESS, process_); 376 return getpriority(PRIO_PROCESS, process_);
375 } 377 }
376 378
377 } // namespace base 379 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process.h ('k') | base/process/process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698