aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os/shell.c')
-rw-r--r--src/nvim/os/shell.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 398d94b606..912dc95aca 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -293,19 +293,15 @@ int os_system(const char *cmd,
if (input) {
WBuffer *input_buffer = wstream_new_buffer((char *) input, len, 1, NULL);
- // we want to be notified when the write completes
- job_write_cb(job, system_write_cb);
-
if (!job_write(job, input_buffer)) {
// couldn't write, stop the job and tell the user about it
job_stop(job);
return -1;
}
- } else {
- // close the input stream, let the process know that no input is coming
- job_close_in(job);
}
+ // close the input stream, let the process know that no more input is coming
+ job_close_in(job);
int status = job_wait(job, -1);
// prepare the out parameters if requested
@@ -353,17 +349,6 @@ static void system_data_cb(RStream *rstream, void *data, bool eof)
buf->len += nread;
}
-static void system_write_cb(WStream *wstream,
- void *data,
- size_t pending,
- int status)
-{
- if (pending == 0) {
- Job *job = data;
- job_close_in(job);
- }
-}
-
/// Parses a command string into a sequence of words, taking quotes into
/// consideration.
///