diff --git a/ChangeLog b/ChangeLog index 9756bfef8..ed112c07b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-10-27 Tor Lillqvist + + * configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes + trouble. + + * glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs + (http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html) + and others. We waited for events only for GPollFDs whose events + field had G_IO_IN set. We need to wait also for events for + GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the + process of being connect()ed are one such case. Also silence a + couple of gcc warnings. + Fri Oct 18 13:41:30 2002 Manish Singh * glib/giochannel.c (g_io_channel_read_line_backend): avoid diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9756bfef8..ed112c07b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +2002-10-27 Tor Lillqvist + + * configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes + trouble. + + * glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs + (http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html) + and others. We waited for events only for GPollFDs whose events + field had G_IO_IN set. We need to wait also for events for + GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the + process of being connect()ed are one such case. Also silence a + couple of gcc warnings. + Fri Oct 18 13:41:30 2002 Manish Singh * glib/giochannel.c (g_io_channel_read_line_backend): avoid diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 9756bfef8..ed112c07b 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,16 @@ +2002-10-27 Tor Lillqvist + + * configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes + trouble. + + * glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs + (http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html) + and others. We waited for events only for GPollFDs whose events + field had G_IO_IN set. We need to wait also for events for + GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the + process of being connect()ed are one such case. Also silence a + couple of gcc warnings. + Fri Oct 18 13:41:30 2002 Manish Singh * glib/giochannel.c (g_io_channel_read_line_backend): avoid diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 9756bfef8..ed112c07b 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +2002-10-27 Tor Lillqvist + + * configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes + trouble. + + * glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs + (http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html) + and others. We waited for events only for GPollFDs whose events + field had G_IO_IN set. We need to wait also for events for + GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the + process of being connect()ed are one such case. Also silence a + couple of gcc warnings. + Fri Oct 18 13:41:30 2002 Manish Singh * glib/giochannel.c (g_io_channel_read_line_backend): avoid diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 9756bfef8..ed112c07b 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +2002-10-27 Tor Lillqvist + + * configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes + trouble. + + * glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs + (http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html) + and others. We waited for events only for GPollFDs whose events + field had G_IO_IN set. We need to wait also for events for + GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the + process of being connect()ed are one such case. Also silence a + couple of gcc warnings. + Fri Oct 18 13:41:30 2002 Manish Singh * glib/giochannel.c (g_io_channel_read_line_backend): avoid diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 9756bfef8..ed112c07b 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +2002-10-27 Tor Lillqvist + + * configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes + trouble. + + * glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs + (http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html) + and others. We waited for events only for GPollFDs whose events + field had G_IO_IN set. We need to wait also for events for + GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the + process of being connect()ed are one such case. Also silence a + couple of gcc warnings. + Fri Oct 18 13:41:30 2002 Manish Singh * glib/giochannel.c (g_io_channel_read_line_backend): avoid diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9756bfef8..ed112c07b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +2002-10-27 Tor Lillqvist + + * configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes + trouble. + + * glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs + (http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html) + and others. We waited for events only for GPollFDs whose events + field had G_IO_IN set. We need to wait also for events for + GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the + process of being connect()ed are one such case. Also silence a + couple of gcc warnings. + Fri Oct 18 13:41:30 2002 Manish Singh * glib/giochannel.c (g_io_channel_read_line_backend): avoid diff --git a/configure.in b/configure.in index c4852187a..5ef6c607a 100644 --- a/configure.in +++ b/configure.in @@ -915,7 +915,12 @@ dnl *********************** G_MODULE_LIBS= G_MODULE_LIBS_EXTRA= G_MODULE_PLUGIN_LIBS= -G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` +if test x"$glib_native_win32" = xyes; then + dnl No use for this on Win32 + G_MODULE_LDFLAGS= +else + G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` +fi dnl G_MODULE_IMPL= don't reset, so cmd-line can override G_MODULE_NEED_USCORE=0 G_MODULE_BROKEN_RTLD_GLOBAL=0 diff --git a/glib/gmain.c b/glib/gmain.c index 14e09ac77..9f6eeac62 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -268,17 +268,14 @@ g_poll (GPollFD *fds, for (f = fds; f < &fds[nfds]; ++f) if (f->fd >= 0) { - if (f->events & G_IO_IN) + if (f->fd == G_WIN32_MSG_HANDLE) + poll_msgs = TRUE; + else { - if (f->fd == G_WIN32_MSG_HANDLE) - poll_msgs = TRUE; - else - { #ifdef G_MAIN_POLL_DEBUG - g_print ("g_poll: waiting for %#x\n", f->fd); + g_print ("g_poll: waiting for %#x\n", f->fd); #endif - handles[nhandles++] = (HANDLE) f->fd; - } + handles[nhandles++] = (HANDLE) f->fd; } } @@ -327,7 +324,10 @@ g_poll (GPollFD *fds, */ timer = SetTimer (NULL, 0, timeout, NULL); if (timer == 0) - g_warning (G_STRLOC ": SetTimer() failed"); + { + g_warning (G_STRLOC ": SetTimer() failed"); + ready = WAIT_TIMEOUT; + } else { #ifdef G_MAIN_POLL_DEBUG @@ -381,7 +381,7 @@ g_poll (GPollFD *fds, } #ifdef G_MAIN_POLL_DEBUG - g_print ("wait returns %d%s\n", + g_print ("wait returns %ld%s\n", ready, (ready == WAIT_FAILED ? " (WAIT_FAILED)" : (ready == WAIT_TIMEOUT ? " (WAIT_TIMEOUT)" : @@ -408,10 +408,13 @@ g_poll (GPollFD *fds, else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles) for (f = fds; f < &fds[nfds]; ++f) { - if ((f->events & G_IO_IN) + if ((f->events & (G_IO_IN | G_IO_OUT)) && f->fd == (gint) handles[ready - WAIT_OBJECT_0]) { - f->revents |= G_IO_IN; + if (f->events & G_IO_IN) + f->revents |= G_IO_IN; + else + f->revents |= G_IO_OUT; #ifdef G_MAIN_POLL_DEBUG g_print ("g_poll: got event %#x\n", f->fd); #endif