Trap CL-MOUNT-INFO conditions

When CL-MOUNT-INFO can't open the file containing the mount
information, /etc/mtab by default, it will signal an error. Handle the
error so that StumpWM doesn't crash.
This commit is contained in:
cage 2020-01-01 13:37:55 +01:00 committed by Javier Olaechea
parent 3a9629ce55
commit 12108cf29f

View file

@ -114,14 +114,20 @@ Filesystem type
(format nil "~a%" value)))
(defun disk-get-device (path)
#+linux (cl-mount-info:mountpoint->device path)
#+linux
(handler-case
(cl-mount-info:mountpoint->device path)
(error () "ERR"))
#-linux (disk-usage-get-field path 0))
(defun disk-get-mount-point (path)
path)
(defun disk-get-filesystem-type (path)
#+linux (cl-mount-info:mountpoint->fstype path)
#+linux
(handler-case
(cl-mount-info:mountpoint->fstype path)
(error () "ERR"))
#-linux "filesystem type supported only on GNU/Linux :-(")
(defun use-fallback-method-p ()