+2002-03-16 Tor Lillqvist <tml@iki.fi>
+
+ * glib/giowin32.c: Some debugging output formatting changes. The
+ following two changes fixes a problem with buffered GIOChannels,
+ noticed with the help of Owen's test program, thanks!
+ (g_io_win32_prepare): Return value that takes the buffer condition
+ into account, like g_io_unix_prepare() does.
+ (g_io_win32_check): Ditto, like g_io_unix_check().
+
Thu Mar 14 17:37:45 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Fix some
+2002-03-16 Tor Lillqvist <tml@iki.fi>
+
+ * glib/giowin32.c: Some debugging output formatting changes. The
+ following two changes fixes a problem with buffered GIOChannels,
+ noticed with the help of Owen's test program, thanks!
+ (g_io_win32_prepare): Return value that takes the buffer condition
+ into account, like g_io_unix_prepare() does.
+ (g_io_win32_check): Ditto, like g_io_unix_check().
+
Thu Mar 14 17:37:45 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Fix some
+2002-03-16 Tor Lillqvist <tml@iki.fi>
+
+ * glib/giowin32.c: Some debugging output formatting changes. The
+ following two changes fixes a problem with buffered GIOChannels,
+ noticed with the help of Owen's test program, thanks!
+ (g_io_win32_prepare): Return value that takes the buffer condition
+ into account, like g_io_unix_prepare() does.
+ (g_io_win32_check): Ditto, like g_io_unix_check().
+
Thu Mar 14 17:37:45 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Fix some
+2002-03-16 Tor Lillqvist <tml@iki.fi>
+
+ * glib/giowin32.c: Some debugging output formatting changes. The
+ following two changes fixes a problem with buffered GIOChannels,
+ noticed with the help of Owen's test program, thanks!
+ (g_io_win32_prepare): Return value that takes the buffer condition
+ into account, like g_io_unix_prepare() does.
+ (g_io_win32_check): Ditto, like g_io_unix_check().
+
Thu Mar 14 17:37:45 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Fix some
+2002-03-16 Tor Lillqvist <tml@iki.fi>
+
+ * glib/giowin32.c: Some debugging output formatting changes. The
+ following two changes fixes a problem with buffered GIOChannels,
+ noticed with the help of Owen's test program, thanks!
+ (g_io_win32_prepare): Return value that takes the buffer condition
+ into account, like g_io_unix_prepare() does.
+ (g_io_win32_check): Ditto, like g_io_unix_check().
+
Thu Mar 14 17:37:45 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Fix some
+2002-03-16 Tor Lillqvist <tml@iki.fi>
+
+ * glib/giowin32.c: Some debugging output formatting changes. The
+ following two changes fixes a problem with buffered GIOChannels,
+ noticed with the help of Owen's test program, thanks!
+ (g_io_win32_prepare): Return value that takes the buffer condition
+ into account, like g_io_unix_prepare() does.
+ (g_io_win32_check): Ditto, like g_io_unix_check().
+
Thu Mar 14 17:37:45 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Fix some
+2002-03-16 Tor Lillqvist <tml@iki.fi>
+
+ * glib/giowin32.c: Some debugging output formatting changes. The
+ following two changes fixes a problem with buffered GIOChannels,
+ noticed with the help of Owen's test program, thanks!
+ (g_io_win32_prepare): Return value that takes the buffer condition
+ into account, like g_io_unix_prepare() does.
+ (g_io_win32_check): Ditto, like g_io_unix_check().
+
Thu Mar 14 17:37:45 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Fix some
g_io_channel_ref ((GIOChannel *)channel);
if (channel->debug)
- g_print ("read_thread %#x: start fd:%d, data_avail:%#x, space_avail:%#x\n",
+ g_print ("read_thread %#x: start fd:%d, data_avail:%#x space_avail:%#x\n",
channel->thread_id,
channel->fd,
(guint) channel->data_avail_event,
g_io_channel_ref ((GIOChannel *)channel);
if (channel->debug)
- g_print ("select_thread %#x: start fd:%d,\n\tdata_avail:%#x, data_avail_noticed:%#x\n",
+ g_print ("select_thread %#x: start fd:%d data_avail:%#x data_avail_noticed:%#x\n",
channel->thread_id,
channel->fd,
(guint) channel->data_avail_event,
channel->revents |= G_IO_ERR;
if (channel->debug)
- g_print ("select_thread %#x: resetting data_avail_noticed,\n"
- "\tsetting data_avail\n",
+ g_print ("select_thread %#x: resetting data_avail_noticed, setting data_avail\n",
channel->thread_id);
ResetEvent (channel->data_avail_noticed_event);
SetEvent (channel->data_avail_event);
gint *timeout)
{
GIOWin32Watch *watch = (GIOWin32Watch *)source;
+ GIOCondition buffer_condition = g_io_channel_get_buffer_condition (watch->channel);
GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel;
*timeout = -1;
+ if (channel->debug)
+ g_print ("g_io_win32_prepare: for thread %#x buffer_condition:%#x\n"
+ " watch->pollfd.events:%#x watch->pollfd.revents:%#x channel->revents:%#x\n",
+ channel->thread_id, buffer_condition,
+ watch->pollfd.events, watch->pollfd.revents, channel->revents);
+
if (channel->type == G_IO_WIN32_FILE_DESC)
{
LOCK (channel->mutex);
if (channel->running && channel->wrp == channel->rdp)
- channel->revents = 0;
+ {
+ if (channel->debug)
+ g_print ("g_io_win32_prepare: for thread %#x, setting channel->revents = 0\n",
+ channel->thread_id);
+ channel->revents = 0;
+ }
UNLOCK (channel->mutex);
}
else if (channel->type == G_IO_WIN32_SOCKET)
channel->revents = 0;
if (channel->debug)
- g_print ("g_io_win32_prepare: thread %#x, setting data_avail_noticed\n",
+ g_print ("g_io_win32_prepare: for thread %#x, setting data_avail_noticed\n",
channel->thread_id);
SetEvent (channel->data_avail_noticed_event);
if (channel->debug)
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;
+ return ((watch->condition & buffer_condition) == watch->condition);
}
static gboolean
GIOCondition buffer_condition = g_io_channel_get_buffer_condition (watch->channel);
if (channel->debug)
- g_print ("g_io_win32_check: for thread %#x:\n"
- "\twatch->pollfd.events:%#x, watch->pollfd.revents:%#x, channel->revents:%#x\n",
- channel->thread_id,
+ g_print ("g_io_win32_check: for thread %#x buffer_condition:%#x\n"
+ " watch->pollfd.events:%#x watch->pollfd.revents:%#x channel->revents:%#x\n",
+ channel->thread_id, buffer_condition,
watch->pollfd.events, watch->pollfd.revents, channel->revents);
if (channel->type != G_IO_WIN32_WINDOWS_MESSAGES)
channel->thread_id);
}
- return (watch->pollfd.revents & watch->condition);
+ return ((watch->pollfd.revents | buffer_condition) & watch->condition);
}
static gboolean