aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-02-05 16:04:45 +0900
committererw7 <erw7.github@gmail.com>2020-06-10 22:21:14 +0900
commitd17e38e48209c19b63d809c5b807613f15aa03c8 (patch)
treed65d1445fcf8befb2ea556b180bd3d05019f7bc1 /src/nvim/event
parentd8c5d122f1ba95bc71a78c5d70465bfa88623bd7 (diff)
downloadrneovim-d17e38e48209c19b63d809c5b807613f15aa03c8.tar.gz
rneovim-d17e38e48209c19b63d809c5b807613f15aa03c8.tar.bz2
rneovim-d17e38e48209c19b63d809c5b807613f15aa03c8.zip
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
Diffstat (limited to 'src/nvim/event')
-rw-r--r--src/nvim/event/libuv_process.c7
-rw-r--r--src/nvim/event/process.h2
2 files changed, 5 insertions, 4 deletions
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;
};