From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.devel Subject: Re: bug in server-start Date: Tue, 16 Dec 2008 12:49:32 +0100 Message-ID: <18759.38348.81160.828820@a1i15.kph.uni-mainz.de> References: <18758.7352.558182.931572@kahikatea.snap.net.nz> <18758.14760.572830.277734@kahikatea.snap.net.nz> <200812151724.mBFHOSnS029425@mothra.ics.uci.edu> <18759.21210.387155.565065@a1ihome1.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1229428196 14302 80.91.229.12 (16 Dec 2008 11:49:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Dec 2008 11:49:56 +0000 (UTC) Cc: Ulrich Mueller , Dan Nicolaescu , emacs-devel@gnu.org, Nick Roberts , Stefan Monnier To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 16 12:51:01 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 1LCYS4-0000Q2-Hj for ged-emacs-devel@m.gmane.org; Tue, 16 Dec 2008 12:51:00 +0100 Original-Received: from localhost ([127.0.0.1]:58859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCYQs-0006hP-HW for ged-emacs-devel@m.gmane.org; Tue, 16 Dec 2008 06:49:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCYQn-0006h6-A0 for emacs-devel@gnu.org; Tue, 16 Dec 2008 06:49:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCYQm-0006gc-IG for emacs-devel@gnu.org; Tue, 16 Dec 2008 06:49:41 -0500 Original-Received: from [199.232.76.173] (port=33723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCYQm-0006gT-A3 for emacs-devel@gnu.org; Tue, 16 Dec 2008 06:49:40 -0500 Original-Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:50895) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LCYQk-0001oQ-Vv for emacs-devel@gnu.org; Tue, 16 Dec 2008 06:49:40 -0500 Original-Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mBGBnXYH006229; Tue, 16 Dec 2008 12:49:33 +0100 Original-Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.2/8.13.4) with ESMTP id mBGBnWW6023755; Tue, 16 Dec 2008 12:49:32 +0100 Original-Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.2/8.14.2/Submit) id mBGBnWTX023749; Tue, 16 Dec 2008 12:49:32 +0100 In-Reply-To: X-Mailer: VM 8.0.9 under Emacs 22.3.1 (i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 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:106959 Archived-At: >>>>> On Tue, 16 Dec 2008, Juanma Barranquero wrote: >> Exit with an error, please. And if possible, the parent process should >> return a nonzero exit status. (AFAICS, not calling daemon-initialized >> should be sufficient for this, but I haven't tested it.) It turns out that I should have tested this ... > Please, try the attached patch. Looks good, except for the exit status of the parent which is zero. The following will test for one character to be read from the pipe (which is sent when daemon-initialized is called): --- src/emacs.c +++ src/emacs.c @@ -1124,7 +1124,7 @@ } while (retval == -1 && errno == EINTR); - if (retval < 0) + if (retval <= 0) { fprintf (stderr, "Error reading status from child\n"); exit (1); Ulrich