summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorsbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 03:08:46 +0000
committersbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 03:08:46 +0000
commiteb769aa29d226c499e9089788b9c992a802bbd71 (patch)
treefa3dcb9f8a192ade7c104b151a8ca6f93b9124e5 /native_client_sdk
parent42c8c0b74d77c7923e0afaad9aafbc5b823e2fe2 (diff)
downloadchromium_src-eb769aa29d226c499e9089788b9c992a802bbd71.zip
chromium_src-eb769aa29d226c499e9089788b9c992a802bbd71.tar.gz
chromium_src-eb769aa29d226c499e9089788b9c992a802bbd71.tar.bz2
[NaCl SDK] ppapi_main: use line buffering for stdout/stderr
Without this, printf() to stdout and stderr appear in the chrome console as multiple lines which makes it close to unusable. BUG= Review URL: https://chromiumcodereview.appspot.com/12091078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/libraries/ppapi_main/ppapi_instance.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/native_client_sdk/src/libraries/ppapi_main/ppapi_instance.cc b/native_client_sdk/src/libraries/ppapi_main/ppapi_instance.cc
index 64e3d16..3a2450b 100644
--- a/native_client_sdk/src/libraries/ppapi_main/ppapi_instance.cc
+++ b/native_client_sdk/src/libraries/ppapi_main/ppapi_instance.cc
@@ -161,6 +161,8 @@ bool PPAPIInstance::ProcessProperties() {
int fd0 = open(stdin_path, O_RDONLY);
int fd1 = open(stdout_path, O_WRONLY);
int fd2 = open(stderr_path, O_WRONLY);
+ setvbuf(stderr, NULL, _IOLBF, 0);
+ setvbuf(stdout, NULL, _IOLBF, 0);
return (fd0 == 0) && (fd1 == 1) && (fd2 == 2);
}