diff options
| author | Daniel Hahler <git@thequod.de> | 2019-08-09 15:34:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-09 15:34:06 +0200 |
| commit | 939d9053bdf2f56286640c581eb4e2ff5a856540 (patch) | |
| tree | 8ba6e3bbda157caad29732b0b619566037db1644 /src/nvim/os | |
| parent | fa0c677a63079e5d27ff037ea8f1e23a71fe6680 (diff) | |
| download | rneovim-939d9053bdf2f56286640c581eb4e2ff5a856540.tar.gz rneovim-939d9053bdf2f56286640c581eb4e2ff5a856540.tar.bz2 rneovim-939d9053bdf2f56286640c581eb4e2ff5a856540.zip | |
channels: reflect exit due to signals in exit status code (#10573)
Uses `128 + term_signal` in case of exit due to a signal.
Fixes https://github.com/neovim/neovim/issues/10571.
Diffstat (limited to 'src/nvim/os')
| -rw-r--r-- | src/nvim/os/pty_process_unix.c | 2 | ||||
| -rw-r--r-- | src/nvim/os/pty_process_win.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index 5fdf0e6181..f0bc13783c 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -288,7 +288,7 @@ static void chld_handler(uv_signal_t *handle, int signum) if (WIFEXITED(stat)) { proc->status = WEXITSTATUS(stat); } else if (WIFSIGNALED(stat)) { - proc->status = WTERMSIG(stat); + proc->status = 128 + WTERMSIG(stat); } proc->internal_exit_cb(proc); } diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c index c5f8efadff..290668bca3 100644 --- a/src/nvim/os/pty_process_win.c +++ b/src/nvim/os/pty_process_win.c @@ -252,7 +252,7 @@ static void pty_process_finish2(PtyProcess *ptyproc) DWORD exit_code = 0; GetExitCodeProcess(ptyproc->process_handle, &exit_code); - proc->status = (int)exit_code; + proc->status = proc->exit_signal ? 128 + proc->exit_signal : (int)exit_code; CloseHandle(ptyproc->process_handle); ptyproc->process_handle = NULL; |