diff options
| author | Eli Zaretskii | 2016-01-12 18:41:58 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-01-12 18:41:58 +0200 |
| commit | 58a622d473112f8ff5b4bdb3e49bc6573dfd3404 (patch) | |
| tree | 58b618f654cae22d1e5f102cbb48bec56e833d45 /src/w32proc.c | |
| parent | 1f6898d0510cd15455f665c0f38451755a374243 (diff) | |
| download | emacs-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.c | 7 |
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 | |||
| 3702 | process temporarily). A value of zero disables waiting entirely. */); | 3702 | process 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. | ||
| 3707 | The size is in bytes, and must be non-negative. The default is zero, | ||
| 3708 | which lets the OS use its default size, usually 4KB (4096 bytes). | ||
| 3709 | Any 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. |
| 3707 | This applies when performing completions and file name expansion. | 3714 | This applies when performing completions and file name expansion. |