aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/job.c6
-rw-r--r--src/nvim/os/rstream.c12
2 files changed, 15 insertions, 3 deletions
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
diff --git a/src/nvim/os/rstream.c b/src/nvim/os/rstream.c
index f16226cdd1..e36a0213c8 100644
--- a/src/nvim/os/rstream.c
+++ b/src/nvim/os/rstream.c
@@ -190,6 +190,18 @@ RStream * rstream_new(rstream_cb cb, RBuffer *buffer, void *data)
return rv;
}
+/// Returns the read pointer used by the rstream.
+char *rstream_read_ptr(RStream *rstream)
+{
+ return rbuffer_read_ptr(rstream->buffer);
+}
+
+/// Returns the number of bytes before the rstream is full.
+size_t rstream_available(RStream *rstream)
+{
+ return rbuffer_available(rstream->buffer);
+}
+
/// Frees all memory allocated for a RStream instance
///
/// @param rstream The `RStream` instance