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

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

Issue 8662006: Fix a number of issues with the process handling (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ 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 "bin/process.h" 5 #include "bin/process.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 if (WIFSIGNALED(status)) { 100 if (WIFSIGNALED(status)) {
101 exit_code = WTERMSIG(status); 101 exit_code = WTERMSIG(status);
102 negative = 1; 102 negative = 1;
103 } 103 }
104 ProcessInfo* process = LookupProcess(pid); 104 ProcessInfo* process = LookupProcess(pid);
105 if (process != NULL) { 105 if (process != NULL) {
106 int message[3] = { pid, exit_code, negative }; 106 int message[3] = { pid, exit_code, negative };
107 intptr_t result = 107 intptr_t result =
108 FDUtils::WriteToBlocking(process->fd(), &message, sizeof(message)); 108 FDUtils::WriteToBlocking(process->fd(), &message, sizeof(message));
109 if (result != sizeof(message)) { 109 if (result != sizeof(message) && errno != EPIPE) {
110 perror("ExitHandler notification failed"); 110 perror("ExitHandler notification failed");
111 } 111 }
112 close(process->fd()); 112 close(process->fd());
113 } 113 }
114 } 114 }
115 } 115 }
116 116
117 117
118 int Process::Start(const char* path, 118 int Process::Start(const char* path,
119 char* arguments[], 119 char* arguments[],
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 if (result == -1) { 338 if (result == -1) {
339 return false; 339 return false;
340 } 340 }
341 return true; 341 return true;
342 } 342 }
343 343
344 344
345 void Process::Exit(intptr_t id) { 345 void Process::Exit(intptr_t id) {
346 RemoveProcess(id); 346 RemoveProcess(id);
347 } 347 }
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