If we are watching the same fd several times (for different conditions,
authorTor Lillqvist <tml@iki.fi>
Tue, 6 Jun 2000 06:56:03 +0000 (06:56 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Tue, 6 Jun 2000 06:56:03 +0000 (06:56 +0000)
2000-06-06  Tor Lillqvist  <tml@iki.fi>

* giowin32.c (g_io_channel_win32_pipe_readable): If we are
watching the same fd several times (for different conditions, with
different callbacks), check them all. Only call the callback for
G_IO_IN from here. (This bug popped up when a watch for
G_IO_ERR|G_IO_HUP was added to gimplib.)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
giowin32.c
glib/giowin32.c

index fd32701..fbe04c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index fd32701..fbe04c9 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index fd32701..fbe04c9 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index fd32701..fbe04c9 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index fd32701..fbe04c9 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index fd32701..fbe04c9 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index fd32701..fbe04c9 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index fd32701..fbe04c9 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-06  Tor Lillqvist  <tml@iki.fi>
+
+       * giowin32.c (g_io_channel_win32_pipe_readable): If we are
+       watching the same fd several times (for different conditions, with
+       different callbacks), check them all. Only call the callback for
+       G_IO_IN from here. (This bug popped up when a watch for
+       G_IO_ERR|G_IO_HUP was added to gimplib.)
+
 2000-05-30  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_locale_get_codeset): Implement on Win32.
index d5e467e..88c5c10 100644 (file)
@@ -1026,10 +1026,10 @@ g_io_channel_win32_pipe_readable (gint  fd,
   for (i = 0; i < n_watched_pipes; i++)
     if (watched_pipes[i].fd == fd)
       {
-       if (watched_pipes[i].channel->offset < offset)
+       if ((watched_pipes[i].watch->condition & G_IO_IN)
+           && watched_pipes[i].channel->offset < offset)
          (*watched_pipes[i].watch->callback) (watched_pipes[i].watch->channel,
                                               G_IO_IN,
                                               watched_pipes[i].user_data);
-       break;
       }
 }
index d5e467e..88c5c10 100644 (file)
@@ -1026,10 +1026,10 @@ g_io_channel_win32_pipe_readable (gint  fd,
   for (i = 0; i < n_watched_pipes; i++)
     if (watched_pipes[i].fd == fd)
       {
-       if (watched_pipes[i].channel->offset < offset)
+       if ((watched_pipes[i].watch->condition & G_IO_IN)
+           && watched_pipes[i].channel->offset < offset)
          (*watched_pipes[i].watch->callback) (watched_pipes[i].watch->channel,
                                               G_IO_IN,
                                               watched_pipes[i].user_data);
-       break;
       }
 }