aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32proc.c
diff options
context:
space:
mode:
authorEli Zaretskii2016-01-12 18:41:58 +0200
committerEli Zaretskii2016-01-12 18:41:58 +0200
commit58a622d473112f8ff5b4bdb3e49bc6573dfd3404 (patch)
tree58b618f654cae22d1e5f102cbb48bec56e833d45 /src/w32proc.c
parent1f6898d0510cd15455f665c0f38451755a374243 (diff)
downloademacs-58a622d473112f8ff5b4bdb3e49bc6573dfd3404.tar.gz
emacs-58a622d473112f8ff5b4bdb3e49bc6573dfd3404.zip
Make piping to subprocesses more robust on MS-Windows
* src/w32.c (sys_write): Don't write to a pipe more stuff than its buffer can hold. Don't return -1 if something has been written to the pipe. Zero out 'errno' before calling '_write', to avoid returning a stale value. (Bug#22344) * src/w32proc.c (syms_of_ntproc) <w32-pipe-buffer-size>: New variable. * src/w32.c (pipe2): Use it to request a user-defined size for the pipe being created. * etc/NEWS: Mention 'w32-pipe-buffer-size'. * doc/emacs/msdos.texi (Windows Processes): Document 'w32-pipe-buffer-size'.
Diffstat (limited to 'src/w32proc.c')
-rw-r--r--src/w32proc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index a65f085fb3d..a89a9850466 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -3702,6 +3702,13 @@ of time slices to wait (effectively boosting the priority of the child
3702process temporarily). A value of zero disables waiting entirely. */); 3702process temporarily). A value of zero disables waiting entirely. */);
3703 w32_pipe_read_delay = 50; 3703 w32_pipe_read_delay = 50;
3704 3704
3705 DEFVAR_INT ("w32-pipe-buffer-size", w32_pipe_buffer_size,
3706 doc: /* Size of buffer for pipes created to communicate with subprocesses.
3707The size is in bytes, and must be non-negative. The default is zero,
3708which lets the OS use its default size, usually 4KB (4096 bytes).
3709Any negative value means to use the default value of zero. */);
3710 w32_pipe_buffer_size = 0;
3711
3705 DEFVAR_LISP ("w32-downcase-file-names", Vw32_downcase_file_names, 3712 DEFVAR_LISP ("w32-downcase-file-names", Vw32_downcase_file_names,
3706 doc: /* Non-nil means convert all-upper case file names to lower case. 3713 doc: /* Non-nil means convert all-upper case file names to lower case.
3707This applies when performing completions and file name expansion. 3714This applies when performing completions and file name expansion.