From 700b6e5ff2919c43508417241d41a43fd428b99e Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 6 Jun 2000 06:56:03 +0000 Subject: [PATCH] If we are watching the same fd several times (for different conditions, 2000-06-06 Tor Lillqvist * 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 | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-12 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ giowin32.c | 4 ++-- glib/giowin32.c | 4 ++-- 10 files changed, 68 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd32701..fbe04c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index fd32701..fbe04c9 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fd32701..fbe04c9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index fd32701..fbe04c9 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index fd32701..fbe04c9 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index fd32701..fbe04c9 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fd32701..fbe04c9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fd32701..fbe04c9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2000-06-06 Tor Lillqvist + + * 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 * gutils.c (g_locale_get_codeset): Implement on Win32. diff --git a/giowin32.c b/giowin32.c index d5e467e..88c5c10 100644 --- a/giowin32.c +++ b/giowin32.c @@ -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; } } diff --git a/glib/giowin32.c b/glib/giowin32.c index d5e467e..88c5c10 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -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; } } -- 2.7.4