diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-02-20 11:37:55 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-02-20 12:32:23 +0100 |
commit | 04fdbfe17d5c8242f54459472120177188949f82 (patch) | |
tree | 796687774910d29e8627d1b6142c7d370fa45610 /src | |
parent | 09b51bbf87b16af9a186cea750ada748d89aa259 (diff) | |
download | rneovim-04fdbfe17d5c8242f54459472120177188949f82.tar.gz rneovim-04fdbfe17d5c8242f54459472120177188949f82.tar.bz2 rneovim-04fdbfe17d5c8242f54459472120177188949f82.zip |
jobwait: return -2 on interrupt also with timeout
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/event/process.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index 4eb2dd0baf..a06f5f4ff3 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -151,7 +151,6 @@ void process_close_streams(Process *proc) FUNC_ATTR_NONNULL_ALL int process_wait(Process *proc, int ms, MultiQueue *events) FUNC_ATTR_NONNULL_ARG(1) { - bool interrupted = false; if (!proc->refcount) { int status = proc->status; LOOP_PROCESS_EVENTS(proc->loop, proc->events, 0); @@ -173,7 +172,6 @@ int process_wait(Process *proc, int ms, MultiQueue *events) // we'll assume that a user frantically hitting interrupt doesn't like // the current job. Signal that it has to be killed. if (got_int) { - interrupted = true; got_int = false; process_stop(proc); if (ms == -1) { @@ -184,14 +182,13 @@ int process_wait(Process *proc, int ms, MultiQueue *events) } else { LOOP_PROCESS_EVENTS(proc->loop, events, 0); } + + proc->status = -2; } if (proc->refcount == 1) { // Job exited, collect status and manually invoke close_cb to free the job // resources - if (interrupted) { - proc->status = -2; - } decref(proc); if (events) { // the decref call created an exit event, process it now |