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

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

Issue 154273003: Make std* blocking file-descriptors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « no previous file | runtime/bin/eventhandler_linux.cc » ('j') | runtime/bin/file_linux.cc » ('J')
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 <stdlib.h> 5 #include <stdlib.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) { 110 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) {
111 intptr_t length = 0; 111 intptr_t length = 0;
112 uint8_t* chars = NULL; 112 uint8_t* chars = NULL;
113 Dart_Handle str = Dart_GetNativeArgument(args, 0); 113 Dart_Handle str = Dart_GetNativeArgument(args, 0);
114 Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); 114 Dart_Handle result = Dart_StringToUTF8(str, &chars, &length);
115 if (Dart_IsError(result)) { 115 if (Dart_IsError(result)) {
116 // TODO(turnidge): Consider propagating some errors here. What if 116 // TODO(turnidge): Consider propagating some errors here. What if
117 // an isolate gets interrupted by the embedder in the middle of 117 // an isolate gets interrupted by the embedder in the middle of
118 // Dart_StringToUTF8? We need to make sure not to swallow the 118 // Dart_StringToUTF8? We need to make sure not to swallow the
119 // interrupt. 119 // interrupt.
120 Platform::PrintBlocking(stdout, "%s\n", Dart_GetError(result)); 120 printf("%s\n", Dart_GetError(result));
121 } else { 121 } else {
122 Platform::PrintBlocking(stdout, "%.*s\n", static_cast<int>(length), chars); 122 printf("%.*s\n", static_cast<int>(length), chars);
123 } 123 }
124 fflush(stdout);
Ivan Posva 2014/02/11 04:08:37 If you are using fflush here it would be consisten
Anders Johnsen 2014/02/14 08:43:28 Done.
124 } 125 }
125 126
126 } // namespace bin 127 } // namespace bin
127 } // namespace dart 128 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/eventhandler_linux.cc » ('j') | runtime/bin/file_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698