aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
authorDaiki Ueno2015-04-07 17:42:09 +0900
committerDaiki Ueno2015-04-11 07:59:27 +0900
commitf55ea05bdf60e24c09f9064fc0d2e8a114d6e358 (patch)
treeed901f31fffe7afa1d4644dd9980042d7b35895b /src/w32.c
parenta2940cd43e7931d16d3a3ce2cf5d4acd148dd00c (diff)
downloademacs-f55ea05bdf60e24c09f9064fc0d2e8a114d6e358.tar.gz
emacs-f55ea05bdf60e24c09f9064fc0d2e8a114d6e358.zip
Add facility to collect stderr of async subprocess
* src/w32.h (register_aux_fd): New function declaration. * src/w32.c (register_aux_fd): New function. * src/process.h (struct Lisp_Process): New member stderrproc. * src/process.c (PIPECONN_P): New macro. (PIPECONN1_P): New macro. (Fdelete_process, Fprocess_status, Fset_process_buffer) (Fset_process_filter, Fset_process_sentinel, Fstop_process) (Fcontinue_process): Handle pipe process specially. (create_process): Respect p->stderrproc. (Fmake_pipe_process): New function. (Fmake_process): Add new keyword argument :stderr. (wait_reading_process_output): Specially handle a pipe process when it gets an EOF. (syms_of_process): Register Qpipe and Smake_pipe_process. * doc/lispref/processes.texi (Asynchronous Processes): Document `make-pipe-process' and `:stderr' keyword of `make-process'. * lisp/subr.el (start-process): Suggest to use `make-process' handle standard error separately. * test/automated/process-tests.el (process-test-stderr-buffer) (process-test-stderr-filter): New tests. * etc/NEWS: Mention new process type `pipe' and its usage with the `:stderr' keyword of `make-process'.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 6f16704909c..8721ed919fc 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -9473,6 +9473,26 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
9473 pset_childp (p, childp2); 9473 pset_childp (p, childp2);
9474} 9474}
9475 9475
9476/* For make-pipe-process */
9477void
9478register_aux_fd (int infd)
9479{
9480 child_process *cp;
9481
9482 cp = new_child ();
9483 if (!cp)
9484 error ("Could not create child process");
9485 cp->fd = infd;
9486 cp->status = STATUS_READ_ACKNOWLEDGED;
9487
9488 if (fd_info[ infd ].cp != NULL)
9489 {
9490 error ("fd_info[fd = %d] is already in use", infd);
9491 }
9492 fd_info[ infd ].cp = cp;
9493 fd_info[ infd ].hnd = (HANDLE) _get_osfhandle (infd);
9494}
9495
9476#ifdef HAVE_GNUTLS 9496#ifdef HAVE_GNUTLS
9477 9497
9478ssize_t 9498ssize_t