From d17e38e48209c19b63d809c5b807613f15aa03c8 Mon Sep 17 00:00:00 2001 From: erw7 Date: Wed, 5 Feb 2020 16:04:45 +0900 Subject: Add overlapped option to jobstart When UV_OVERLAPPED_PIPE was used for the pipe passed to the child process, a problem occurred with the standard input of the .Net Framework application (#11809). Therefore, add the overlapped option to jobstart() and change it so that it is set only when necessary --- src/nvim/event/libuv_process.c | 7 ++++--- src/nvim/event/process.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/event') diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index 37b9f73ba4..13517d3df1 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -52,7 +52,7 @@ int libuv_process_spawn(LibuvProcess *uvproc) if (!proc->in.closed) { uvproc->uvstdio[0].flags = UV_CREATE_PIPE | UV_READABLE_PIPE; #ifdef WIN32 - uvproc->uvstdio[0].flags |= UV_OVERLAPPED_PIPE; + uvproc->uvstdio[0].flags |= proc->overlapped ? UV_OVERLAPPED_PIPE : 0; #endif uvproc->uvstdio[0].data.stream = STRUCT_CAST(uv_stream_t, &proc->in.uv.pipe); @@ -61,8 +61,9 @@ int libuv_process_spawn(LibuvProcess *uvproc) if (!proc->out.closed) { uvproc->uvstdio[1].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE; #ifdef WIN32 - // pipe must be readable for IOCP to work. - uvproc->uvstdio[1].flags |= UV_READABLE_PIPE | UV_OVERLAPPED_PIPE; + // pipe must be readable for IOCP to work on Windows. + uvproc->uvstdio[1].flags |= proc->overlapped ? + (UV_READABLE_PIPE | UV_OVERLAPPED_PIPE) : 0; #endif uvproc->uvstdio[1].data.stream = STRUCT_CAST(uv_stream_t, &proc->out.uv.pipe); diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index b677b80bfe..84e81238e9 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -27,7 +27,7 @@ struct process { Stream in, out, err; process_exit_cb cb; internal_process_cb internal_exit_cb, internal_close_cb; - bool closed, detach; + bool closed, detach, overlapped; MultiQueue *events; }; -- cgit