aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-01-18 13:23:17 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-01-18 13:23:17 -0500
commitc7f4e553629f9ac667dee1e920b96c7c327380f6 (patch)
treef274c063280aa880b7e2726918de08f17d183fc6 /src
parentbff48b23d700d6202e1c85564cd7fcb1b3ce4c34 (diff)
parentd7d1b1133277e96c3929082c96ec2fad374a0827 (diff)
downloadrneovim-c7f4e553629f9ac667dee1e920b96c7c327380f6.tar.gz
rneovim-c7f4e553629f9ac667dee1e920b96c7c327380f6.tar.bz2
rneovim-c7f4e553629f9ac667dee1e920b96c7c327380f6.zip
Merge pull request #1798 from oni-link/fix.job.wait
job.c: Prevent early return from job_wait().
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/job.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/os/job.c b/src/nvim/os/job.c
index 17872ab9c9..8db5e3cc39 100644
--- a/src/nvim/os/job.c
+++ b/src/nvim/os/job.c
@@ -310,8 +310,15 @@ int job_wait(Job *job, int ms) FUNC_ATTR_NONNULL_ALL
// 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) {
+ got_int = false;
job_stop(job);
- event_poll(0);
+ if (ms == -1) {
+ // We can only return, if all streams/handles are closed and the job
+ // exited.
+ event_poll_until(-1, job->refcount == 1);
+ } else {
+ event_poll(0);
+ }
}
if (job->refcount == 1) {