]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/battery.el (battery--upower-devices): Protect the D-Bus call.
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 11 Dec 2020 10:31:10 +0000 (11:31 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 11 Dec 2020 10:31:10 +0000 (11:31 +0100)
(Bug#45163)

lisp/battery.el

index e568ab524603c282ff210e6a6577912732daf633..f59ad124794c5c4941243020b478a2b45b931dae 100644 (file)
@@ -661,10 +661,12 @@ Intended as a UPower PropertiesChanged signal handler."
   (cond ((stringp battery-upower-device)
          (list battery-upower-device))
         (battery-upower-device)
-        ((dbus-call-method :system battery-upower-service
-                           battery-upower-path
-                           battery-upower-interface
-                           "EnumerateDevices"))))
+        ((dbus-ignore-errors
+           (dbus-call-method :system battery-upower-service
+                             battery-upower-path
+                             battery-upower-interface
+                             "EnumerateDevices"
+                             :timeout 1000)))))
 
 (defun battery--upower-state (props state)
   "Merge the UPower battery state in PROPS with STATE.