From: Tor Lillqvist Date: Tue, 19 Feb 2002 09:08:24 +0000 (+0000) Subject: Include first here, too. Use g_io_channel_read_chars() instead X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=c7e635a922da36f529f044e6d84a7664691849a1;p=dana%2Fcg-glib.git Include first here, too. Use g_io_channel_read_chars() instead 2002-02-19 Tor Lillqvist * glib/gspawn-win32.c: Include first here, too. Use g_io_channel_read_chars() instead of (deprecated) g_io_channel_read(). Set encoding to NULL for the channels used for the pipes from the child. * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when EOF has been reached. Otherwise, with the above change to gspawn-win32.c, spawn-test hangs. --- diff --git a/ChangeLog b/ChangeLog index 8b5106cc..d71f60d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8b5106cc..d71f60d6 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8b5106cc..d71f60d6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 8b5106cc..d71f60d6 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8b5106cc..d71f60d6 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8b5106cc..d71f60d6 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8b5106cc..d71f60d6 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8b5106cc..d71f60d6 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +2002-02-19 Tor Lillqvist + + * glib/gspawn-win32.c: Include first here, too. Use + g_io_channel_read_chars() instead of (deprecated) + g_io_channel_read(). Set encoding to NULL for the channels used + for the pipes from the child. + + * glib/giowin32.c (buffer_read): Do return G_IO_STATUS_EOF when + EOF has been reached. Otherwise, with the above change to + gspawn-win32.c, spawn-test hangs. + Mon Feb 18 20:18:23 2002 Owen Taylor * glib/libcharset/Makefile.am (EXTRA_DIST): Remove diff --git a/glib/giowin32.c b/glib/giowin32.c index e2a29d5b..fae780c9 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -364,9 +364,11 @@ buffer_read (GIOWin32Channel *channel, LOCK (channel->mutex); if (channel->wrp == channel->rdp && !channel->running) { + if (channel->debug) + g_print ("wrp==rdp, !running\n"); UNLOCK (channel->mutex); *bytes_read = 0; - return G_IO_STATUS_NORMAL; /* as before, normal case ? */ + return G_IO_STATUS_EOF; } } diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c index 7cadc1e8..2b851857 100644 --- a/glib/gspawn-win32.c +++ b/glib/gspawn-win32.c @@ -37,6 +37,8 @@ /* Define this to get some logging all the time */ /* #define G_SPAWN_WIN32_DEBUG */ +#include + #include "glib.h" #include @@ -187,13 +189,13 @@ read_data (GString *str, GIOChannel *iochannel, GError **error) { - GIOError gioerror; + GIOStatus giostatus; gint bytes; gchar buf[4096]; again: - gioerror = g_io_channel_read (iochannel, buf, sizeof (buf), &bytes); + giostatus = g_io_channel_read_chars (iochannel, buf, sizeof (buf), &bytes, NULL); if (bytes == 0) return READ_EOF; @@ -202,9 +204,9 @@ read_data (GString *str, g_string_append_len (str, buf, bytes); return READ_OK; } - else if (gioerror == G_IO_ERROR_AGAIN) + else if (giostatus == G_IO_STATUS_AGAIN) goto again; - else if (gioerror != G_IO_ERROR_NONE) + else if (giostatus == G_IO_STATUS_ERROR) { g_set_error (error, G_SPAWN_ERROR, @@ -312,6 +314,7 @@ g_spawn_sync (const gchar *working_directory, { outstr = g_string_new (""); outchannel = g_io_channel_win32_new_fd (outpipe); + g_io_channel_set_encoding (outchannel, NULL, NULL); g_io_channel_win32_make_pollfd (outchannel, G_IO_IN | G_IO_ERR | G_IO_HUP, &outfd); @@ -321,6 +324,7 @@ g_spawn_sync (const gchar *working_directory, { errstr = g_string_new (""); errchannel = g_io_channel_win32_new_fd (errpipe); + g_io_channel_set_encoding (errchannel, NULL, NULL); g_io_channel_win32_make_pollfd (errchannel, G_IO_IN | G_IO_ERR | G_IO_HUP, &errfd);