]> git.eshelyaron.com Git - emacs.git/commitdiff
Make dbus work in a dumped Emacs
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 12 Oct 2021 11:56:47 +0000 (13:56 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 12 Oct 2021 11:57:52 +0000 (13:57 +0200)
* lisp/net/dbus.el (dbus--init): Make into a defun.
(after-pdump-load-hook): Put it onto the new pdump hook so that
it's run after startup (bug#37331).

lisp/net/dbus.el

index 560ece675174ed9f376b41d2dd20a63127245efc..3fff5398c0680b283a7810ac6e00320c253495e8 100644 (file)
@@ -2252,15 +2252,19 @@ keywords `:system-private' or `:session-private', respectively."
      bus nil dbus-path-local dbus-interface-local
      "Disconnected" #'dbus-handle-bus-disconnect)))
 
\f
-;; Initialize `:system' and `:session' buses.  This adds their file
-;; descriptors to input_wait_mask, in order to detect incoming
-;; messages immediately.
-(when (featurep 'dbusbind)
-  (dbus-ignore-errors
-    (dbus-init-bus :system))
-  (dbus-ignore-errors
-    (dbus-init-bus :session)))
+\f
+(defun dbus--init ()
+  ;; Initialize `:system' and `:session' buses.  This adds their file
+  ;; descriptors to input_wait_mask, in order to detect incoming
+  ;; messages immediately.
+  (when (featurep 'dbusbind)
+    (dbus-ignore-errors
+      (dbus-init-bus :system))
+    (dbus-ignore-errors
+      (dbus-init-bus :session))))
+
+(add-hook 'after-pdump-load-hook #'dbus--init)
+(dbus--init)
 
 (provide 'dbus)