From a4db56be2f214c12377c0985a1902422d98c8032 Mon Sep 17 00:00:00 2001 From: TEC Date: Fri, 23 Jul 2021 03:22:36 +0800 Subject: [PATCH] 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. --- modules/email/mu4e/autoload/mu-lock.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/email/mu4e/autoload/mu-lock.el b/modules/email/mu4e/autoload/mu-lock.el index 34ec9c476..f0b0bc673 100644 --- a/modules/email/mu4e/autoload/mu-lock.el +++ b/modules/email/mu4e/autoload/mu-lock.el @@ -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)