mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
(battery-status-function) Fix errors in Termux
* lisp/battery.el (battery-status-function): In Termux, neither /sys/ or /proc/ are readable on phones that are not rooted. This patch makes Emacs verify if they are readable before it attemps reading them (bug#53026). Copyright-paperwork-exempt: yes
This commit is contained in:
parent
39114e1e2b
commit
3c0e51e4e5
1 changed files with 2 additions and 0 deletions
|
|
@ -96,12 +96,14 @@ Value does not include \".\" or \"..\"."
|
|||
(cond ((member battery-upower-service (dbus-list-activatable-names))
|
||||
#'battery-upower)
|
||||
((and (eq system-type 'gnu/linux)
|
||||
(file-readable-p "/sys/")
|
||||
(battery--find-linux-sysfs-batteries))
|
||||
#'battery-linux-sysfs)
|
||||
((and (eq system-type 'gnu/linux)
|
||||
(file-directory-p "/proc/acpi/battery"))
|
||||
#'battery-linux-proc-acpi)
|
||||
((and (eq system-type 'gnu/linux)
|
||||
(file-readable-p "/proc/")
|
||||
(file-readable-p "/proc/apm"))
|
||||
#'battery-linux-proc-apm)
|
||||
((and (eq system-type 'berkeley-unix)
|
||||
|
|
|
|||
Loading…
Reference in a new issue