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

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

Issue 10697066: IO: Fix error in Process exit handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/process_linux.cc ('k') | runtime/bin/process_win.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 #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 <poll.h> 9 #include <poll.h>
10 #include <signal.h> 10 #include <signal.h>
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 } 209 }
210 } 210 }
211 211
212 212
213 // Entry point for the separate exit code handler thread started by 213 // Entry point for the separate exit code handler thread started by
214 // the ExitCodeHandler. 214 // the ExitCodeHandler.
215 static void ExitCodeHandlerEntry(uword param) { 215 static void ExitCodeHandlerEntry(uword param) {
216 struct pollfd pollfds; 216 struct pollfd pollfds;
217 pollfds.fd = param; 217 pollfds.fd = param;
218 pollfds.events |= POLLIN; 218 pollfds.events = POLLIN;
219 while (true) { 219 while (true) {
220 int result = TEMP_FAILURE_RETRY(poll(&pollfds, 1, -1)); 220 int result = TEMP_FAILURE_RETRY(poll(&pollfds, 1, -1));
221 if (result == -1) { 221 if (result == -1) {
222 ASSERT(EAGAIN == EWOULDBLOCK); 222 ASSERT(EAGAIN == EWOULDBLOCK);
223 if (errno != EWOULDBLOCK) { 223 if (errno != EWOULDBLOCK) {
224 perror("ExitCodeHandler poll failed"); 224 perror("ExitCodeHandler poll failed");
225 } 225 }
226 } else { 226 } else {
227 // Read the byte from the wake-up fd. 227 // Read the byte from the wake-up fd.
228 ASSERT(result = 1); 228 ASSERT(result = 1);
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 if (result == -1) { 555 if (result == -1) {
556 return false; 556 return false;
557 } 557 }
558 return true; 558 return true;
559 } 559 }
560 560
561 561
562 void Process::TerminateExitCodeHandler() { 562 void Process::TerminateExitCodeHandler() {
563 ExitCodeHandler::TerminateExitCodeThread(); 563 ExitCodeHandler::TerminateExitCodeThread();
564 } 564 }
OLDNEW
« no previous file with comments | « runtime/bin/process_linux.cc ('k') | runtime/bin/process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698