emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add facility to collect stderr of async subprocess


From: Eli Zaretskii
Subject: Re: [PATCH] Add facility to collect stderr of async subprocess
Date: Wed, 08 Apr 2015 09:17:21 +0300

> From: Daiki Ueno <address@hidden>
> Date: Wed, 08 Apr 2015 11:55:17 +0900
> Cc: address@hidden
> 
> I updated the patch and it's now much simpler.

Thanks.  I'm not sure I'm following this bit:

> +  if (emacs_pipe (p->open_fd + SUBPROCESS_STDIN) != 0
> +      || emacs_pipe (p->open_fd + READ_FROM_SUBPROCESS) != 0)
> +    report_file_error ("Creating pipe", Qnil);
> +  outchannel = p->open_fd[WRITE_TO_SUBPROCESS];
> +  inchannel = p->open_fd[READ_FROM_SUBPROCESS];
> +
> +  fcntl (inchannel, F_SETFL, O_NONBLOCK);
> +  fcntl (outchannel, F_SETFL, O_NONBLOCK);
> +
> +#ifdef WINDOWSNT
> +  register_aux_fd (inchannel, outchannel);
> +#endif

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?

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]