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

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

Issue 8383037: Improve error handling in the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | « runtime/bin/process_impl.dart ('k') | runtime/bin/process_macos.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 Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #include <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <signal.h> 7 #include <signal.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 79
80 static void SetChildOsErrorMessage(char* os_error_message, 80 static void SetChildOsErrorMessage(char* os_error_message,
81 int os_error_message_len) { 81 int os_error_message_len) {
82 SafeStrNCpy(os_error_message, strerror(errno), os_error_message_len); 82 SafeStrNCpy(os_error_message, strerror(errno), os_error_message_len);
83 } 83 }
84 84
85 85
86 void ExitHandler(int process_signal, siginfo_t* siginfo, void* tmp) { 86 void ExitHandler(int process_signal, siginfo_t* siginfo, void* tmp) {
87 assert(process_signal == SIGCHLD); 87 ASSERT(process_signal == SIGCHLD);
88 struct sigaction act; 88 struct sigaction act;
89 bzero(&act, sizeof(act)); 89 bzero(&act, sizeof(act));
90 act.sa_handler = SIG_IGN; 90 act.sa_handler = SIG_IGN;
91 act.sa_flags = SA_NOCLDSTOP | SA_SIGINFO; 91 act.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
92 if (sigaction(SIGCHLD, &act, 0) != 0) { 92 if (sigaction(SIGCHLD, &act, 0) != 0) {
93 perror("Process start: disabling signal handler failed"); 93 perror("Process start: disabling signal handler failed");
94 } 94 }
95 ProcessInfo* process = LookupProcess(siginfo->si_pid); 95 ProcessInfo* process = LookupProcess(siginfo->si_pid);
96 if (process != NULL) { 96 if (process != NULL) {
97 intptr_t message[2] = { siginfo->si_pid, siginfo->si_status }; 97 intptr_t message[2] = { siginfo->si_pid, siginfo->si_status };
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (result == -1) { 329 if (result == -1) {
330 return false; 330 return false;
331 } 331 }
332 return true; 332 return true;
333 } 333 }
334 334
335 335
336 void Process::Exit(intptr_t id) { 336 void Process::Exit(intptr_t id) {
337 RemoveProcess(id); 337 RemoveProcess(id);
338 } 338 }
OLDNEW
« no previous file with comments | « runtime/bin/process_impl.dart ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698