From d3f81424e5a8de5d184f3ab3e14b632fa70f857d Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 7 Nov 2014 02:38:12 -0300 Subject: job: Only force-close stdout/stderr when the job exits stdout/stderr should only be closed after the job truly exits, or else we can lose data sent by it. --- src/nvim/os/job.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/os/job.c b/src/nvim/os/job.c index 2f610cb51f..7ae2a86fc2 100644 --- a/src/nvim/os/job.c +++ b/src/nvim/os/job.c @@ -270,10 +270,10 @@ void job_stop(Job *job) } job->stopped_time = os_hrtime(); - // Close the standard streams of the job + // Close the job's stdin. If the job doesn't close it's own stdout/stderr, + // they will be closed when the job exits(possibly due to being terminated + // after a timeout) close_job_in(job); - close_job_out(job); - close_job_err(job); if (!stop_requests++) { // When there's at least one stop request pending, start a timer that -- cgit