Bug 500246 - Bug fixes for giowin32
authorTor Lillqvist <tml@novell.com>
Wed, 20 Aug 2008 01:30:31 +0000 (01:30 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Wed, 20 Aug 2008 01:30:31 +0000 (01:30 +0000)
2008-08-20  Tor Lillqvist  <tml@novell.com>

Bug 500246 - Bug fixes for giowin32

* glib/giowin32.c (read_thread) (write_thread): Change the nbytes
variables to signed.
(g_io_channel_win32_make_pollfd): Fix an obvious error in the file
descriptor case leftover after the patch from bug #333098 on
2006-03-02. Thanks to Marcus Brinkmann.

svn path=/trunk/; revision=7373

ChangeLog
glib/giowin32.c

index 2b46e5460671ec6879f1856efeb23bfd92e4368e..32547cfcdb708cc02b399b16bc3ec0168ceb500e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-20  Tor Lillqvist  <tml@novell.com>
+
+       Bug 500246 - Bug fixes for giowin32
+
+       * glib/giowin32.c (read_thread) (write_thread): Change the nbytes
+       variables to signed.
+       (g_io_channel_win32_make_pollfd): Fix an obvious error in the file
+       descriptor case leftover after the patch from bug #333098 on
+       2006-03-02. Thanks to Marcus Brinkmann.
+
 2008-08-20  Tor Lillqvist  <tml@novell.com>
 
        Bug 324234 - Using g_io_add_watch_full() to wait for connect() to
index 4793ad5d7f8a158e4742610b6718842baf0374fe..286b6433e4cace3a72cc6b7ce5b0cc5e1cba9389 100644 (file)
@@ -311,7 +311,7 @@ read_thread (void *parameter)
 {
   GIOWin32Channel *channel = parameter;
   guchar *buffer;
-  guint nbytes;
+  gint nbytes;
 
   g_io_channel_ref ((GIOChannel *)channel);
 
@@ -422,7 +422,7 @@ write_thread (void *parameter)
 {
   GIOWin32Channel *channel = parameter;
   guchar *buffer;
-  guint nbytes;
+  gint nbytes;
 
   g_io_channel_ref ((GIOChannel *)channel);
 
@@ -2095,8 +2095,14 @@ g_io_channel_win32_make_pollfd (GIOChannel   *channel,
 
       fd->fd = (gintptr) win32_channel->data_avail_event;
 
-      if (win32_channel->thread_id == 0 && (condition & G_IO_IN))
+      if (win32_channel->thread_id == 0)
        {
+         /* Is it meaningful for a file descriptor to be polled for
+          * both IN and OUT? For what kind of file descriptor would
+          * that be? Doesn't seem to make sense, in practise the file
+          * descriptors handled here are always read or write ends of
+          * pipes surely, and thus unidirectional.
+          */
          if (condition & G_IO_IN)
            create_thread (win32_channel, condition, read_thread);
          else if (condition & G_IO_OUT)