From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add facility to collect stderr of async subprocess Date: Wed, 08 Apr 2015 16:05:37 +0900 Message-ID: References: <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> <55247A98.5020302@cs.ucla.edu> <83r3rvgn4e.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1428476776 27848 80.91.229.3 (8 Apr 2015 07:06:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Apr 2015 07:06:16 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 08 09:06:06 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 1Yfk3o-00071z-N6 for ged-emacs-devel@m.gmane.org; Wed, 08 Apr 2015 09:06:04 +0200 Original-Received: from localhost ([::1]:51036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfk3n-0000DD-Sm for ged-emacs-devel@m.gmane.org; Wed, 08 Apr 2015 03:06:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfk3Y-0008Pj-Lu for emacs-devel@gnu.org; Wed, 08 Apr 2015 03:05:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yfk3S-0007wE-E9 for emacs-devel@gnu.org; Wed, 08 Apr 2015 03:05:48 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfk3S-0007wA-9q for emacs-devel@gnu.org; Wed, 08 Apr 2015 03:05:42 -0400 Original-Received: from du-a.org ([219.94.251.20]:41028 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Yfk3R-0001Lf-FX; Wed, 08 Apr 2015 03:05:41 -0400 In-Reply-To: <83r3rvgn4e.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Apr 2015 09:17:21 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:185139 Archived-At: Eli Zaretskii writes: > The function register_aux_fd records both of its arguments in the > fd_info[] array. Why do we need to record outchannel? We never watch > on MS-Windows the descriptors used to write to the subprocesses, and > all the writes to them are made from the man thread. E.g., > register_child only registers a single file descriptor. Why do we > need to record two in this case? (If you worry about losing it, then > don't: they are both recorded in the process object.) > > What am I missing? No, that's my misunderstanding. Thanks for pointing it out. Also, serial port related stuff in that function (copied from 'serial_open') was not necessary. The 'register_aux_fd' function now looks like: void register_aux_fd (int fd) { cp = new_child (); if (!cp) error ("Could not create child process"); cp->fd = fd; cp->status = STATUS_READ_ACKNOWLEDGED; if (fd_info[ fd ].cp != NULL) { error ("fd_info[fd = %d] is already in use", fd); } fd_info[ fd ].cp = cp; fd_info[ fd ].hnd = (HANDLE) _get_osfhandle (fd); } Regards, -- Daiki Ueno