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

Unified Diff: runtime/bin/builtin_natives.cc

Issue 25465002: Always mark stdout as blocking when using 'print'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/platform.h » ('j') | tests/standalone/io/print_sync_script.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin_natives.cc
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index 07cc545380ee1341a9702ec39a6c90607f82c33a..80844970dfdce2206c604a829b1ab45166994337 100644
--- a/runtime/bin/builtin_natives.cc
+++ b/runtime/bin/builtin_natives.cc
@@ -13,6 +13,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
#include "bin/io_natives.h"
+#include "bin/platform.h"
namespace dart {
namespace bin {
@@ -108,12 +109,10 @@ void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) {
// an isolate gets interrupted by the embedder in the middle of
// Dart_StringToUTF8? We need to make sure not to swallow the
// interrupt.
- fputs(Dart_GetError(result), stdout);
+ Platform::PrintBlocking(stdout, "%s\n", Dart_GetError(result));
} else {
- fwrite(chars, sizeof(*chars), length, stdout);
+ Platform::PrintBlocking(stdout, "%.*s\n", length, chars);
Søren Gjesse 2013/10/01 07:16:39 I was not aware of the * for precision.
Anders Johnsen 2013/10/01 09:05:21 Let's see if all the platforms supports it :)
}
- fputc('\n', stdout);
- fflush(stdout);
}
} // namespace bin
« no previous file with comments | « no previous file | runtime/bin/platform.h » ('j') | tests/standalone/io/print_sync_script.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698