From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bug in server-start Date: Tue, 16 Dec 2008 10:40:10 -0500 Message-ID: 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> <18759.38348.81160.828820@a1i15.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229442454 2251 80.91.229.12 (16 Dec 2008 15:47:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Dec 2008 15:47:34 +0000 (UTC) Cc: Juanma Barranquero , Nick Roberts , Dan Nicolaescu , emacs-devel@gnu.org To: Ulrich Mueller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 16 16:48:38 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 1LCc9n-0004WL-OH for ged-emacs-devel@m.gmane.org; Tue, 16 Dec 2008 16:48:24 +0100 Original-Received: from localhost ([127.0.0.1]:58496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCc8b-00025F-Ti for ged-emacs-devel@m.gmane.org; Tue, 16 Dec 2008 10:47:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCc1s-0007FE-DP for emacs-devel@gnu.org; Tue, 16 Dec 2008 10:40:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCc1s-0007F2-16 for emacs-devel@gnu.org; Tue, 16 Dec 2008 10:40:12 -0500 Original-Received: from [199.232.76.173] (port=34089 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCc1r-0007Ez-Nd for emacs-devel@gnu.org; Tue, 16 Dec 2008 10:40:11 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:43807) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LCc1r-0005qy-EO for emacs-devel@gnu.org; Tue, 16 Dec 2008 10:40:11 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAOFaR0nO+J7J/2dsb2JhbACBbLwFV5EAgn+BOA X-IronPort-AV: E=Sophos;i="4.36,231,1228107600"; d="scan'208";a="31115222" Original-Received: from 206-248-158-201.dsl.teksavvy.com (HELO ceviche.home) ([206.248.158.201]) by ironport2-out.teksavvy.com with ESMTP; 16 Dec 2008 10:40:10 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id AB461B4060; Tue, 16 Dec 2008 10:40:10 -0500 (EST) In-Reply-To: <18759.38348.81160.828820@a1i15.kph.uni-mainz.de> (Ulrich Mueller's message of "Tue, 16 Dec 2008 12:49:32 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:106966 Archived-At: >>> 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); Indeed, we should return a non-zero status, but this patch ends up with this undesirable "Error reading status from child" message, so we want something better. Stefan