From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: desktop.el and his lock file Date: Wed, 03 Dec 2008 16:19:11 +0900 Message-ID: References: <87ej0qfeu5.fsf@tux.homenetwork> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228288781 15659 80.91.229.12 (3 Dec 2008 07:19:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 07:19:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 08:20:44 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L7m2M-0005AT-W1 for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 08:20:43 +0100 Original-Received: from localhost ([127.0.0.1]:57517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7m1A-0001z7-C2 for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 02:19:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7m14-0001wC-Tj for emacs-devel@gnu.org; Wed, 03 Dec 2008 02:19:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7m12-0001tX-Cm for emacs-devel@gnu.org; Wed, 03 Dec 2008 02:19:21 -0500 Original-Received: from [199.232.76.173] (port=37652 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7m12-0001tU-74 for emacs-devel@gnu.org; Wed, 03 Dec 2008 02:19:20 -0500 Original-Received: from tyo202.gate.nec.co.jp ([202.32.8.206]:33652) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L7m0z-0004FH-22; Wed, 03 Dec 2008 02:19:17 -0500 Original-Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id mB37JCpr013018; Wed, 3 Dec 2008 16:19:12 +0900 (JST) Original-Received: from relay31.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay21.aps.necel.com with ESMTP; Wed, 3 Dec 2008 16:19:11 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.113.195] [10.114.113.195]) by relay31.aps.necel.com with ESMTP; Wed, 3 Dec 2008 16:19:11 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 98DB0455; Wed, 3 Dec 2008 16:19:11 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <87ej0qfeu5.fsf@tux.homenetwork> (Thierry Volpiatto's message of "Tue, 02 Dec 2008 22:26:58 +0100") Original-Lines: 22 X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:106510 Archived-At: Thierry Volpiatto writes: > here is the code i put after line 967 in desktop.el: > > the function is desktop-read > ,---- > | (if (and owner > | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner))) > | ..... > `---- It might be better to use the `signal-process' function with signal number 0 -- that will just check to see if the process exists and return an appropriate exit code (0 = exists, -1 = doesn't exist), without actually sending any signal. [I guess it won't work on windows, but presumably neither does your pipeline... :-] -Miles -- .Numeric stability is probably not all that important when you're guessing.