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

Side by Side Diff: runtime/bin/process_android.cc

Issue 2632483002: VM: Avoid running atexit() handlers during exit() of a failed subprocess spawn (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | runtime/bin/process_linux.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(TARGET_OS_ANDROID) 8 #if defined(TARGET_OS_ANDROID)
9 9
10 #include "bin/process.h" 10 #include "bin/process.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 const int kBufferSize = 1024; 675 const int kBufferSize = 1024;
676 char os_error_message[kBufferSize]; 676 char os_error_message[kBufferSize];
677 Utils::StrError(errno, os_error_message, kBufferSize); 677 Utils::StrError(errno, os_error_message, kBufferSize);
678 int bytes_written = FDUtils::WriteToBlocking(exec_control_[1], &child_errno, 678 int bytes_written = FDUtils::WriteToBlocking(exec_control_[1], &child_errno,
679 sizeof(child_errno)); 679 sizeof(child_errno));
680 if (bytes_written == sizeof(child_errno)) { 680 if (bytes_written == sizeof(child_errno)) {
681 FDUtils::WriteToBlocking(exec_control_[1], os_error_message, 681 FDUtils::WriteToBlocking(exec_control_[1], os_error_message,
682 strlen(os_error_message) + 1); 682 strlen(os_error_message) + 1);
683 } 683 }
684 VOID_TEMP_FAILURE_RETRY(close(exec_control_[1])); 684 VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
685 exit(1); 685
686 // We avoid running through registered atexit() handlers because that is
687 // unnecessary work.
688 _exit(1);
686 } 689 }
687 690
688 691
689 void ReportPid(int pid) { 692 void ReportPid(int pid) {
690 // In the case of starting a detached process the actual pid of that process 693 // In the case of starting a detached process the actual pid of that process
691 // is communicated using the exec control pipe. 694 // is communicated using the exec control pipe.
692 int bytes_written = 695 int bytes_written =
693 FDUtils::WriteToBlocking(exec_control_[1], &pid, sizeof(pid)); 696 FDUtils::WriteToBlocking(exec_control_[1], &pid, sizeof(pid));
694 ASSERT(bytes_written == sizeof(int)); 697 ASSERT(bytes_written == sizeof(int));
695 USE(bytes_written); 698 USE(bytes_written);
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); 996 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL));
994 } 997 }
995 } 998 }
996 999
997 } // namespace bin 1000 } // namespace bin
998 } // namespace dart 1001 } // namespace dart
999 1002
1000 #endif // defined(TARGET_OS_ANDROID) 1003 #endif // defined(TARGET_OS_ANDROID)
1001 1004
1002 #endif // !defined(DART_IO_DISABLED) 1005 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698