* 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
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.
#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 ();
}