Mu4e: Confirm that lockfile pid is an emacs proc

Or else another app can be given the same PID and we'll be complaining
another Emacs process is using mu4e when that simply isn't true.
This commit is contained in:
TEC 2021-07-23 03:22:36 +08:00
parent abe2ac28c0
commit a4db56be2f
No known key found for this signature in database
GPG key ID: 779591AFDB81F06C

View file

@ -20,7 +20,8 @@
(insert-file-contents +mu4e-lock-file)
(buffer-string))))
(process (process-attributes pid)))
(if process (cons pid process)
(if (and process (string-match-p "emacs" (alist-get 'args process)))
(cons pid process)
(delete-file +mu4e-lock-file) nil))))
(defun +mu4e-lock-available (&optional strict)