GNU bug report logs -
#1474
23.0.60; desktop.el don't check if pid in his lock file is always in use
Previous Next
Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Date: Tue, 2 Dec 2008 21:55:04 UTC
Severity: wishlist
Tags: patch
Merged with 25232
Found in version 24.4
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Stefan Kangas <stefan <at> marxist.se>
> Cc: emacs <at> gentoo.org, 1474 <at> debbugs.gnu.org, thierry.volpiatto <at> gmail.com
> Date: Mon, 27 Apr 2020 12:34:08 +0200
>
> >> +(defun desktop--emacs-pid-running-p (pid)
> >> + "Return t if an Emacs process with PID exists."
> >> + (when-let ((attr (process-attributes pid)))
> >> + (string-match "^emacs$" (alist-get 'comm attr))))
> >
> > I understand the rationale for the string-match test, but what if the
> > executable file name of Emacs was "transformed", per the
> > '--program-transform-name' option of the configure script? And even
> > if it wasn't transformed, this will not match emacs-XX.YY and
> > emacs.exe.
>
> Good point. But would you suggest to use no check at all, or is there
> some other check we could reasonably use? I assume it is impossible
> to use the process name due to '--program-transform-name'.
Perhaps you could use the name you find in command-line-args? Note
that it might include leading directories, and at least on Windows the
directory separator might either be a slash or a backslash, so use of
file-name-nondirectory is advised.
This bug report was last modified 3 years and 57 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.