Set the GIOChannels for stdout and stderr to unbuffered. Otherwise the
authorTor Lillqvist <tml@novell.com>
Sun, 1 Jan 2006 11:15:56 +0000 (11:15 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 1 Jan 2006 11:15:56 +0000 (11:15 +0000)
2006-01-01  Tor Lillqvist  <tml@novell.com>

* 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
ChangeLog.pre-2-10
ChangeLog.pre-2-12
glib/gspawn-win32.c

index 8faed1a..3ebe056 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-01-01  Tor Lillqvist  <tml@novell.com>
+
+       * 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  <mclasen@redhat.com>
 
        * glib/gutils.c (glib_check_version): Fix a copy-and-paste error
index 8faed1a..3ebe056 100644 (file)
@@ -1,3 +1,11 @@
+2006-01-01  Tor Lillqvist  <tml@novell.com>
+
+       * 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  <mclasen@redhat.com>
 
        * glib/gutils.c (glib_check_version): Fix a copy-and-paste error
index 8faed1a..3ebe056 100644 (file)
@@ -1,3 +1,11 @@
+2006-01-01  Tor Lillqvist  <tml@novell.com>
+
+       * 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  <mclasen@redhat.com>
 
        * glib/gutils.c (glib_check_version): Fix a copy-and-paste error
index 56af86d..0d22799 100644 (file)
@@ -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. */