| OLD | NEW |
| 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 "base/process/launch.h" | 5 #include "base/process/launch.h" |
| 6 | 6 |
| 7 #include <dirent.h> | 7 #include <dirent.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <signal.h> | 10 #include <signal.h> |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 limit.rlim_cur = limit.rlim_max; | 378 limit.rlim_cur = limit.rlim_max; |
| 379 if (setrlimit(resource, &limit) < 0) { | 379 if (setrlimit(resource, &limit) < 0) { |
| 380 RAW_LOG(WARNING, "setrlimit failed"); | 380 RAW_LOG(WARNING, "setrlimit failed"); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| 386 #if defined(OS_MACOSX) | 386 #if defined(OS_MACOSX) |
| 387 RestoreDefaultExceptionHandler(); | 387 RestoreDefaultExceptionHandler(); |
| 388 if (!options.replacement_bootstrap_name.empty()) |
| 389 ReplaceBootstrapPort(options.replacement_bootstrap_name); |
| 388 #endif // defined(OS_MACOSX) | 390 #endif // defined(OS_MACOSX) |
| 389 | 391 |
| 390 ResetChildSignalHandlersToDefaults(); | 392 ResetChildSignalHandlersToDefaults(); |
| 391 SetSignalMask(orig_sigmask); | 393 SetSignalMask(orig_sigmask); |
| 392 | 394 |
| 393 #if 0 | 395 #if 0 |
| 394 // When debugging it can be helpful to check that we really aren't making | 396 // When debugging it can be helpful to check that we really aren't making |
| 395 // any hidden calls to malloc. | 397 // any hidden calls to malloc. |
| 396 void *malloc_thunk = | 398 void *malloc_thunk = |
| 397 reinterpret_cast<void*>(reinterpret_cast<intptr_t>(malloc) & ~4095); | 399 reinterpret_cast<void*>(reinterpret_cast<intptr_t>(malloc) & ~4095); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 std::string* output, | 655 std::string* output, |
| 654 int* exit_code) { | 656 int* exit_code) { |
| 655 // Run |execve()| with the current environment and store "unlimited" data. | 657 // Run |execve()| with the current environment and store "unlimited" data. |
| 656 GetAppOutputInternalResult result = GetAppOutputInternal( | 658 GetAppOutputInternalResult result = GetAppOutputInternal( |
| 657 cl.argv(), NULL, output, std::numeric_limits<std::size_t>::max(), true, | 659 cl.argv(), NULL, output, std::numeric_limits<std::size_t>::max(), true, |
| 658 exit_code); | 660 exit_code); |
| 659 return result == EXECUTE_SUCCESS; | 661 return result == EXECUTE_SUCCESS; |
| 660 } | 662 } |
| 661 | 663 |
| 662 } // namespace base | 664 } // namespace base |
| OLD | NEW |