From 3a5d0834854b88d6139b96e93c84f9156fb63b33 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sat, 7 Jan 2023 12:16:19 -0500 Subject: fixed big problem with process_* --- os-posix.c | 9 ++++++--- test/lsp/go/.ted-root | 0 test/lsp/go/main.go | 0 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 test/lsp/go/.ted-root create mode 100644 test/lsp/go/main.go diff --git a/os-posix.c b/os-posix.c index f34d33b..3e32c20 100644 --- a/os-posix.c +++ b/os-posix.c @@ -320,9 +320,12 @@ long long process_read_stderr(Process *proc, char *data, size_t size) { } static void process_close_pipes(Process *proc) { - close(proc->stdin_pipe); - close(proc->stdout_pipe); - close(proc->stderr_pipe); + if (proc->stdin_pipe) + close(proc->stdin_pipe); + if (proc->stdout_pipe) + close(proc->stdout_pipe); + if (proc->stderr_pipe) + close(proc->stderr_pipe); proc->stdin_pipe = 0; proc->stdout_pipe = 0; proc->stderr_pipe = 0; diff --git a/test/lsp/go/.ted-root b/test/lsp/go/.ted-root new file mode 100644 index 0000000..e69de29 diff --git a/test/lsp/go/main.go b/test/lsp/go/main.go new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3