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

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

Issue 8503006: Fix handling of async IO from pipes on Windows (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/eventhandler_win.cc ('k') | tests/standalone/standalone.status » ('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 <stdio.h> 5 #include <stdio.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 /* 9 /*
10 * Run ./process_test <outstream> <echocount> <exitcode> <crash> 10 * Run ./process_test <outstream> <echocount> <exitcode> <crash>
(...skipping 20 matching lines...) Expand all
31 int exit_code = atoi(argv[3]); 31 int exit_code = atoi(argv[3]);
32 int crash = atoi(argv[4]); 32 int crash = atoi(argv[4]);
33 33
34 const int kLineSize = 128; 34 const int kLineSize = 128;
35 char line[kLineSize]; 35 char line[kLineSize];
36 36
37 while ((echo_count != echo_counter) && 37 while ((echo_count != echo_counter) &&
38 (fgets(line, kLineSize, stdin) != NULL)) { 38 (fgets(line, kLineSize, stdin) != NULL)) {
39 if (outstream == 0) { 39 if (outstream == 0) {
40 fprintf(stdout, "%s", line); 40 fprintf(stdout, "%s", line);
41 fflush(stdout);
41 } else if (outstream == 1) { 42 } else if (outstream == 1) {
42 fprintf(stderr, "%s", line); 43 fprintf(stderr, "%s", line);
44 fflush(stderr);
43 } else if (outstream == 2) { 45 } else if (outstream == 2) {
44 fprintf(stdout, "%s", line); 46 fprintf(stdout, "%s", line);
45 fprintf(stderr, "%s", line); 47 fprintf(stderr, "%s", line);
48 fflush(stdout);
49 fflush(stderr);
46 } 50 }
47 echo_counter++; 51 echo_counter++;
48 } 52 }
49 53
50 if (crash == 1) { 54 if (crash == 1) {
51 int* segfault = NULL; 55 int* segfault = NULL;
52 *segfault = 1; 56 *segfault = 1;
53 } 57 }
54 58
55
56 return exit_code; 59 return exit_code;
57 } 60 }
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_win.cc ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698