aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2020-12-11 11:31:10 +0100
committerMichael Albinus2020-12-11 11:31:10 +0100
commitdf769c2effabb62afcf9fdf02185b1dc2638818c (patch)
treef931693afb4b73f0283e8fe1c56963c027ffe525
parent9bfcee52c1f191706d50adc194739f642686607e (diff)
downloademacs-df769c2effabb62afcf9fdf02185b1dc2638818c.tar.gz
emacs-df769c2effabb62afcf9fdf02185b1dc2638818c.zip
* lisp/battery.el (battery--upower-devices): Protect the D-Bus call.
(Bug#45163)
-rw-r--r--lisp/battery.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/battery.el b/lisp/battery.el
index e568ab52460..f59ad124794 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -661,10 +661,12 @@ Intended as a UPower PropertiesChanged signal handler."
661 (cond ((stringp battery-upower-device) 661 (cond ((stringp battery-upower-device)
662 (list battery-upower-device)) 662 (list battery-upower-device))
663 (battery-upower-device) 663 (battery-upower-device)
664 ((dbus-call-method :system battery-upower-service 664 ((dbus-ignore-errors
665 battery-upower-path 665 (dbus-call-method :system battery-upower-service
666 battery-upower-interface 666 battery-upower-path
667 "EnumerateDevices")))) 667 battery-upower-interface
668 "EnumerateDevices"
669 :timeout 1000)))))
668 670
669(defun battery--upower-state (props state) 671(defun battery--upower-state (props state)
670 "Merge the UPower battery state in PROPS with STATE. 672 "Merge the UPower battery state in PROPS with STATE.