Don't set on Win32, only causes trouble.
authorTor Lillqvist <tml@iki.fi>
Sat, 26 Oct 2002 22:53:21 +0000 (22:53 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 26 Oct 2002 22:53:21 +0000 (22:53 +0000)
2002-10-27  Tor Lillqvist  <tml@iki.fi>

* 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.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
glib/gmain.c

index 9756bfe..ed112c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2002-10-27  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <yosh@gimp.org>
 
        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
index 9756bfe..ed112c0 100644 (file)
@@ -1,3 +1,16 @@
+2002-10-27  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <yosh@gimp.org>
 
        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
index 9756bfe..ed112c0 100644 (file)
@@ -1,3 +1,16 @@
+2002-10-27  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <yosh@gimp.org>
 
        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
index 9756bfe..ed112c0 100644 (file)
@@ -1,3 +1,16 @@
+2002-10-27  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <yosh@gimp.org>
 
        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
index 9756bfe..ed112c0 100644 (file)
@@ -1,3 +1,16 @@
+2002-10-27  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <yosh@gimp.org>
 
        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
index 9756bfe..ed112c0 100644 (file)
@@ -1,3 +1,16 @@
+2002-10-27  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <yosh@gimp.org>
 
        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
index 9756bfe..ed112c0 100644 (file)
@@ -1,3 +1,16 @@
+2002-10-27  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <yosh@gimp.org>
 
        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
index c485218..5ef6c60 100644 (file)
@@ -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
index 14e09ac..9f6eeac 100644 (file)
@@ -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