Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use

From: Thierry Volpiatto <[email-masked]>
Date: Wed, 03 Dec 2008 07:36:53 +0100

"Juanma Barranquero" <[email-masked]> writes:

> On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto
> <[email-masked]> wrote:
>
>> | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner)))
>
> In Emacs 23.X I think you could use `system-process-attributes'
> instead of running an external ps process.

Yes, here is the code that can be used in desktop.el:

,----
| (and (system-process-attributes owner)
|      (string-match "emacs"
|                    (cdr (assq 'comm
|                               (system-process-attributes owner)))))
`----

> But one way or the other, what if the desktop lock file resides in a
> non-local drive?

If emacs process number <owner> doesn't exist, the "else" block is used.
  
-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France