Don't let D-bus autolaunch mess up SIGCHLD handling.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 May 2013 01:41:52 +0000 (18:41 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 May 2013 01:41:52 +0000 (18:41 -0700)
* xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
not already configured.

Fixes: debbugs:14474

src/ChangeLog
src/xterm.c

index bfc51b8..5069811 100644 (file)
@@ -1,5 +1,9 @@
 2013-05-31  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
+       * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
+       not already configured.
+
        * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
 
 2013-05-29  Eli Zaretskii  <eliz@gnu.org>
index 7505aa3..7038de7 100644 (file)
@@ -9897,6 +9897,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
 
         XSetLocaleModifiers ("");
 
+       /* If D-Bus is not already configured, inhibit D-Bus autolaunch,
+          as autolaunch can mess up Emacs's SIGCHLD handler.
+          FIXME: Rewrite subprocess handlers to use glib's child watchers.
+          See Bug#14474.  */
+       if (! egetenv ("DBUS_SESSION_BUS_ADDRESS"))
+         xputenv ("DBUS_SESSION_BUS_ADDRESS=unix:path=/dev/null");
+
         /* Emacs can only handle core input events, so make sure
            Gtk doesn't use Xinput or Xinput2 extensions.  */
        xputenv ("GDK_CORE_DEVICE_EVENTS=1");