From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: emacs@gentoo.org, 1474@debbugs.gnu.org, thierry.volpiatto@gmail.com
Subject: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Date: Mon, 27 Apr 2020 17:50:09 +0300 [thread overview]
Message-ID: <83sggp3rvi.fsf@gnu.org> (raw)
In-Reply-To: <87r1w98bfj.fsf@stefankangas.se> (message from Stefan Kangas on Mon, 27 Apr 2020 12:34:08 +0200)
> From: Stefan Kangas <stefan@marxist.se>
> Cc: emacs@gentoo.org, 1474@debbugs.gnu.org, thierry.volpiatto@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.
next prev parent reply other threads:[~2020-04-27 14:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 21:43 bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Thierry Volpiatto
2008-12-02 22:39 ` Juanma Barranquero
2008-12-03 6:36 ` Thierry Volpiatto
2008-12-03 8:25 ` Juanma Barranquero
2008-12-03 8:47 ` Thierry Volpiatto
2008-12-03 9:15 ` Juanma Barranquero
2008-12-03 10:08 ` Thierry Volpiatto
2008-12-03 10:20 ` Juanma Barranquero
2008-12-03 21:27 ` Stefan Monnier
2008-12-03 9:14 ` Ulrich Mueller
2008-12-03 9:16 ` Juanma Barranquero
2008-12-02 22:52 ` Stefan Monnier
2008-12-02 23:06 ` Ulrich Mueller
2008-12-03 6:30 ` Thierry Volpiatto
2020-01-24 16:47 ` Stefan Kangas
2020-02-08 14:23 ` Stefan Kangas
2020-02-08 15:20 ` Eli Zaretskii
2020-04-27 10:34 ` Stefan Kangas
2020-04-27 14:50 ` Eli Zaretskii [this message]
2022-03-24 8:25 ` bug#1474: bug#25232: 24.4; Eliminate - Warning: Desktop file appears to be " Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83sggp3rvi.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=1474@debbugs.gnu.org \
--cc=emacs@gentoo.org \
--cc=stefan@marxist.se \
--cc=thierry.volpiatto@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).