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

Side by Side Diff: runtime/bin/process_linux.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 | « runtime/bin/process_android.cc ('k') | 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 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_LINUX) 8 #if defined(TARGET_OS_LINUX)
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 error_buf[kBufferSize]; 676 char error_buf[kBufferSize];
677 char* os_error_message = Utils::StrError(errno, error_buf, kBufferSize); 677 char* os_error_message = Utils::StrError(errno, error_buf, 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 sigaction(signal, &act, NULL); 993 sigaction(signal, &act, NULL);
991 } 994 }
992 } 995 }
993 996
994 } // namespace bin 997 } // namespace bin
995 } // namespace dart 998 } // namespace dart
996 999
997 #endif // defined(TARGET_OS_LINUX) 1000 #endif // defined(TARGET_OS_LINUX)
998 1001
999 #endif // !defined(DART_IO_DISABLED) 1002 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « runtime/bin/process_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698