From 07e1d54fb726583c6733a10d6570126045b0d99d Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 1 Jan 2006 11:15:56 +0000 Subject: [PATCH] Set the GIOChannels for stdout and stderr to unbuffered. Otherwise the 2006-01-01 Tor Lillqvist * glib/gspawn-win32.c (g_spawn_sync_utf8): Set the GIOChannels for stdout and stderr to unbuffered. Otherwise the giochannel layer will try to read from them regardless whether the g_io_channel_win32_poll() call here has indicated readability or not. (#325310) --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-12 | 8 ++++++++ glib/gspawn-win32.c | 6 ++++++ 4 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8faed1a..3ebe056 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-01-01 Tor Lillqvist + + * glib/gspawn-win32.c (g_spawn_sync_utf8): Set the GIOChannels for + stdout and stderr to unbuffered. Otherwise the giochannel layer + will try to read from them regardless whether the + g_io_channel_win32_poll() call here has indicated + readability or not. (#325310) + 2005-12-29 Matthias Clasen * glib/gutils.c (glib_check_version): Fix a copy-and-paste error diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8faed1a..3ebe056 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2006-01-01 Tor Lillqvist + + * glib/gspawn-win32.c (g_spawn_sync_utf8): Set the GIOChannels for + stdout and stderr to unbuffered. Otherwise the giochannel layer + will try to read from them regardless whether the + g_io_channel_win32_poll() call here has indicated + readability or not. (#325310) + 2005-12-29 Matthias Clasen * glib/gutils.c (glib_check_version): Fix a copy-and-paste error diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 8faed1a..3ebe056 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +2006-01-01 Tor Lillqvist + + * glib/gspawn-win32.c (g_spawn_sync_utf8): Set the GIOChannels for + stdout and stderr to unbuffered. Otherwise the giochannel layer + will try to read from them regardless whether the + g_io_channel_win32_poll() call here has indicated + readability or not. (#325310) + 2005-12-29 Matthias Clasen * glib/gutils.c (glib_check_version): Fix a copy-and-paste error diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c index 56af86d..0d22799 100644 --- a/glib/gspawn-win32.c +++ b/glib/gspawn-win32.c @@ -1038,9 +1038,12 @@ g_spawn_sync_utf8 (const gchar *working_directory, outstr = g_string_new (NULL); outchannel = g_io_channel_win32_new_fd (outpipe); g_io_channel_set_encoding (outchannel, NULL, NULL); + g_io_channel_set_buffered (outchannel, FALSE); g_io_channel_win32_make_pollfd (outchannel, G_IO_IN | G_IO_ERR | G_IO_HUP, &outfd); + if (debug) + g_print ("outfd=%x\n", outfd.fd); } if (errpipe >= 0) @@ -1048,9 +1051,12 @@ g_spawn_sync_utf8 (const gchar *working_directory, errstr = g_string_new (NULL); errchannel = g_io_channel_win32_new_fd (errpipe); g_io_channel_set_encoding (errchannel, NULL, NULL); + g_io_channel_set_buffered (errchannel, FALSE); g_io_channel_win32_make_pollfd (errchannel, G_IO_IN | G_IO_ERR | G_IO_HUP, &errfd); + if (debug) + g_print ("errfd=%x\n", errfd.fd); } /* Read data until we get EOF on all pipes. */ -- 2.7.4