]> code.delx.au - gnu-emacs/commitdiff
Tickle glib by waiting for Emacs itself, not for process 0.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jun 2013 18:34:06 +0000 (11:34 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jun 2013 18:34:06 +0000 (11:34 -0700)
* process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
Wait for self, not for 0.  This can't hurt on GNU or similar
system, and may help with Cygwin.

Fixes: debbugs:14569
src/ChangeLog
src/process.c

index 34876d4759be370cfad66f930b28f9d779522701..b178f1130e0ed8b4a2a0857c2ec73cf4de2caf62 100644 (file)
@@ -1,5 +1,10 @@
 2013-06-11  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
+       * process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
+       Wait for self, not for 0.  This can't hurt on GNU or similar
+       system, and may help with Cygwin.
+
        * keyboard.c: Don't use PROP (...) as an lvalue.
        (parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
        Use set_prop (A, B), not PROP (A) = B.
index e51b45bd64f3da7d0b69a968d6ae4ebfea1316a8..a873dd0cdb2ba528248d4821f64308f31d29d070 100644 (file)
@@ -7068,9 +7068,10 @@ init_process_emacs (void)
 #endif
     {
 #if defined HAVE_GLIB && !defined WINDOWSNT
-      /* Tickle glib's child-handling code so that it initializes its
+      /* Tickle glib's child-handling code.  Ask glib to wait for Emacs itself;
+        this should always fail, but is enough to initialize glib's
         private SIGCHLD handler.  */
-      g_source_unref (g_child_watch_source_new (0));
+      g_source_unref (g_child_watch_source_new (getpid ()));
 #endif
       catch_child_signal ();
     }