]> git.eshelyaron.com Git - emacs.git/commitdiff
Reset dbus registered buses on dump load
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 11 Sep 2019 17:19:07 +0000 (10:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 11 Sep 2019 17:19:31 +0000 (10:19 -0700)
Problem reported by Leonard Lausen (Bug#37331).
* src/dbusbind.c: Include pdumper.h.
(syms_of_dbusbind_for_pdumper):
New function, to reset the registered buses.
(syms_of_dbusbind): Use it, fixing a TODO.

src/dbusbind.c

index 7f4c8717f42d3d909bc6f1495c3e2029e0bd92e4..de67dc94f9e737912bb385848dfc702c3b4b0f72 100644 (file)
@@ -26,6 +26,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include "lisp.h"
 #include "termhooks.h"
 #include "keyboard.h"
+#include "pdumper.h"
 #include "process.h"
 
 #ifndef DBUS_NUM_MESSAGE_TYPES
@@ -1681,6 +1682,12 @@ init_dbusbind (void)
   xputenv ("DBUS_FATAL_WARNINGS=0");
 }
 
+static void
+syms_of_dbusbind_for_pdumper (void)
+{
+  xd_registered_buses = Qnil;
+}
+
 void
 syms_of_dbusbind (void)
 {
@@ -1829,13 +1836,10 @@ be called when the D-Bus reply message arrives.  */);
 #endif
 
   /* Initialize internal objects.  */
-  xd_registered_buses = Qnil;
+  pdumper_do_now_and_after_load (syms_of_dbusbind_for_pdumper);
   staticpro (&xd_registered_buses);
 
-  // TODO: reset buses on dump load
-
   Fprovide (intern_c_string ("dbusbind"), Qnil);
-
 }
 
 #endif /* HAVE_DBUS */