From: Hans Breuer Date: Sun, 22 Jul 2001 21:15:22 +0000 (+0000) Subject: make the code actually have an effect (Use |= to set bits). Not absolutely X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=371fe04203f503f973eb0ee0024428447bff2329;p=dana%2Fcg-glib.git make the code actually have an effect (Use |= to set bits). Not absolutely 2001-07-22 Hans Breuer * glib/giochannel.c (g_io_channel_get_buffer_condition) : make the code actually have an effect (Use |= to set bits). Not absolutely sure if is the right one. * glib/giowin32.c (g_io_win32_) : don't modify watch->condition but restored the previous behaviour. Now gio-test as well as The Gimp work again ... --- diff --git a/ChangeLog b/ChangeLog index a353a6b3..161333f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index a353a6b3..161333f0 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a353a6b3..161333f0 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index a353a6b3..161333f0 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index a353a6b3..161333f0 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index a353a6b3..161333f0 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a353a6b3..161333f0 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a353a6b3..161333f0 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2001-07-22 Hans Breuer + + * glib/giochannel.c (g_io_channel_get_buffer_condition) : make + the code actually have an effect (Use |= to set bits). Not + absolutely sure if is the right one. + + * glib/giowin32.c (g_io_win32_) : don't modify + watch->condition but restored the previous behaviour. + Now gio-test as well as The Gimp work again ... + 2001-07-21 Hans Breuer * glib/giowin32.c (g_io_channel_new_file) : set the diff --git a/glib/giochannel.c b/glib/giochannel.c index 15609202..bfe42ccf 100644 --- a/glib/giochannel.c +++ b/glib/giochannel.c @@ -479,10 +479,10 @@ g_io_channel_get_buffer_condition (GIOChannel *channel) if ((channel->read_buf && (channel->read_buf->len > 0)) /* FIXME full chars how? */ || (channel->encoded_read_buf && (channel->encoded_read_buf->len > 0))) - condition &= G_IO_IN; + condition |= G_IO_IN; if (channel->write_buf && (channel->write_buf->len < channel->buf_size)) - condition &= G_IO_OUT; + condition |= G_IO_OUT; return condition; } diff --git a/glib/giowin32.c b/glib/giowin32.c index 18cd1b1d..84e00099 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -321,7 +321,7 @@ buffer_read (GIOWin32Channel *channel, { UNLOCK (channel->mutex); *bytes_read = 0; - return G_IO_STATUS_EOF; /* Is this correct? FIXME */ + return G_IO_STATUS_NORMAL; /* as before, normal case ? */ } } @@ -514,6 +514,8 @@ g_io_win32_prepare (GSource *source, channel->thread_id); } + return FALSE; + /* XXX: why should we want to do this ? */ watch->condition = g_io_channel_get_buffer_condition (watch->channel); return (watch->pollfd.revents & (G_IO_IN | G_IO_OUT)) == watch->condition; @@ -525,6 +527,8 @@ g_io_win32_check (GSource *source) MSG msg; GIOWin32Watch *watch = (GIOWin32Watch *)source; GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel; + GIOCondition buffer_condition = g_io_channel_get_buffer_condition (watch->channel); + if (channel->debug) g_print ("g_io_win32_check: for thread %#x:\n" @@ -552,8 +556,6 @@ g_io_win32_check (GSource *source) channel->thread_id); } - watch->condition &= g_io_channel_get_buffer_condition (watch->channel); - return (watch->pollfd.revents & watch->condition); } @@ -659,7 +661,7 @@ g_io_win32_msg_read (GIOChannel *channel, win32_channel->hwnd); if (!PeekMessage (&msg, win32_channel->hwnd, 0, 0, PM_REMOVE)) return G_IO_STATUS_AGAIN; - + memmove (buf, &msg, sizeof (MSG)); *bytes_read = sizeof (MSG); @@ -804,6 +806,7 @@ g_io_win32_fd_read (GIOChannel *channel, *bytes_read = result; + return G_IO_STATUS_NORMAL; /* XXX: 0 byte read an error ?? */ return (result > 0) ? G_IO_STATUS_NORMAL : G_IO_STATUS_EOF; } @@ -975,6 +978,7 @@ repeat: { *bytes_read = result; + return G_IO_STATUS_NORMAL; /* XXX: 0 byte read an error ?? */ return (result > 0) ? G_IO_STATUS_NORMAL : G_IO_STATUS_EOF; } } @@ -1101,7 +1105,7 @@ g_io_channel_new_file (const gchar *filename, mode_num = MODE_A; break; default: - g_warning ("Invalid GIOFileMode %s.\n", mode); + g_warning (G_STRLOC ": Invalid GIOFileMode %s.\n", mode); return NULL; } @@ -1117,7 +1121,7 @@ g_io_channel_new_file (const gchar *filename, } /* Fall through */ default: - g_warning ("Invalid GIOFileMode %s.\n", mode); + g_warning (G_STRLOC ": Invalid GIOFileMode %s.\n", mode); return NULL; }