From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add facility to collect stderr of async subprocess Date: Wed, 08 Apr 2015 08:56:17 +0300 Message-ID: <83twwrgo3i.fsf@gnu.org> References: <87d24d3uwz.fsf-ueno@gnu.org> <83pp87y6iu.fsf@gnu.org> <83mw3bxz9f.fsf@gnu.org> <83k2yfx8zi.fsf@gnu.org> <83egomxog1.fsf@gnu.org> <83ego5tjgt.fsf@gnu.org> <877ftno4fr.fsf-ueno@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1428472585 30200 80.91.229.3 (8 Apr 2015 05:56:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Apr 2015 05:56:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Daiki Ueno Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 08 07:56:16 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YfiyG-0007tT-Oj for ged-emacs-devel@m.gmane.org; Wed, 08 Apr 2015 07:56:16 +0200 Original-Received: from localhost ([::1]:50676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfiyG-0000BI-0R for ged-emacs-devel@m.gmane.org; Wed, 08 Apr 2015 01:56:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfiyD-0000Au-1y for emacs-devel@gnu.org; Wed, 08 Apr 2015 01:56:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yfiy9-00021v-P1 for emacs-devel@gnu.org; Wed, 08 Apr 2015 01:56:12 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:48794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfiy9-00021P-Gs; Wed, 08 Apr 2015 01:56:09 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NMH00J003PB4Z00@mtaout24.012.net.il>; Wed, 08 Apr 2015 08:47:38 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NMH00GXY43DB330@mtaout24.012.net.il>; Wed, 08 Apr 2015 08:47:38 +0300 (IDT) In-reply-to: <877ftno4fr.fsf-ueno@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185133 Archived-At: > From: Daiki Ueno > Cc: emacs-devel@gnu.org > Date: Wed, 08 Apr 2015 09:21:28 +0900 > > Eli Zaretskii writes: > > > However, please note that the call to emacs_pipe2 in make-pipe-process > > will hit an assertion in w32.c's implementation of pipe2. > > OK, I added a wrapper around pipe2 in w32.c to preserve the assert > condition. With the attached patch, I confirmed that the included test > passes on both Windows and GNU/Linux. Thanks. However, I think this is not the right solution. The assertion is there because w32.c:pipe2 calls _pipe with two flags, _O_BINARY and _O_NOINHERIT, which exactly correspond to the flags being tested by the assertion. To support different combinations of flags, the flags passed to _pipe need to be computed dynamically based on the argument passed to pipe2. By contrast, with your wrapper, the pipe will always be closed in the subprocess, which I think is not what we want (does the test actually test this aspect?), and is at least confusing when reading the source (a.k.a. "looks like a bug"). > - Add a new function 'pipe_open' analogous to 'serial_open', which has > different definitions on Windows and on GNU/Linux The sysdep.c definition of pipe_open is for all Posix platforms, I think, not just for GNU/Linux.