diff options
Diffstat (limited to 'src/nvim/event/libuv_process.c')
-rw-r--r-- | src/nvim/event/libuv_process.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index e528d21a71..be48b39af1 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -1,17 +1,14 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include <assert.h> +#include <locale.h> #include <stdint.h> #include <uv.h> #include "nvim/eval/typval.h" #include "nvim/event/libuv_process.h" -#include "nvim/event/loop.h" #include "nvim/event/process.h" #include "nvim/event/stream.h" +#include "nvim/func_attr.h" #include "nvim/log.h" -#include "nvim/macros.h" #include "nvim/os/os.h" #include "nvim/ui_client.h" @@ -24,7 +21,7 @@ int libuv_process_spawn(LibuvProcess *uvproc) FUNC_ATTR_NONNULL_ALL { Process *proc = (Process *)uvproc; - uvproc->uvopts.file = proc->argv[0]; + uvproc->uvopts.file = process_get_exepath(proc); uvproc->uvopts.args = proc->argv; uvproc->uvopts.flags = UV_PROCESS_WINDOWS_HIDE; #ifdef MSWIN @@ -68,25 +65,22 @@ int libuv_process_spawn(LibuvProcess *uvproc) #ifdef MSWIN 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); + uvproc->uvstdio[0].data.stream = (uv_stream_t *)(&proc->in.uv.pipe); } if (!proc->out.closed) { uvproc->uvstdio[1].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE; #ifdef MSWIN // pipe must be readable for IOCP to work on Windows. - uvproc->uvstdio[1].flags |= proc->overlapped ? - (UV_READABLE_PIPE | UV_OVERLAPPED_PIPE) : 0; + 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); + uvproc->uvstdio[1].data.stream = (uv_stream_t *)(&proc->out.uv.pipe); } if (!proc->err.closed) { uvproc->uvstdio[2].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE; - uvproc->uvstdio[2].data.stream = STRUCT_CAST(uv_stream_t, - &proc->err.uv.pipe); + uvproc->uvstdio[2].data.stream = (uv_stream_t *)(&proc->err.uv.pipe); } else if (proc->fwd_err) { uvproc->uvstdio[2].flags = UV_INHERIT_FD; uvproc->uvstdio[2].data.fd = STDERR_FILENO; |