gsocket: make GSocketSource trigger on G_IO_NVAL
authorDan Winship <danw@gnome.org>
Thu, 29 Aug 2013 13:25:42 +0000 (09:25 -0400)
committerDan Winship <danw@gnome.org>
Thu, 29 Aug 2013 13:25:42 +0000 (09:25 -0400)
Getting G_IO_NVAL probably indicates bugs/race conditions in the
calling code, but if GSocket just ignores it, it will get stuck in an
infinite loop.

gio/gsocket.c

index 7f99a60..cc02784 100644 (file)
@@ -3331,7 +3331,7 @@ socket_source_new (GSocket      *socket,
     }
 #endif
 
-  condition |= G_IO_HUP | G_IO_ERR;
+  condition |= G_IO_HUP | G_IO_ERR | G_IO_NVAL;
 
   source = g_source_new (&socket_source_funcs, sizeof (GSocketSource));
   g_source_set_name (source, "GSocket");