From 1ec7db70ecac75736b5042203e57aae57b65abe6 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Mon, 23 Feb 2015 12:34:02 -0300 Subject: job: Refactor process spawning and startup arguments - process spawning was decoupled from the rest of the job control logic. The goal is reusing it for spawning processes connected to pseudo terminal file descriptors. - job_start now receives a JobOptions structure containing all the startup options. --- src/nvim/os/shell.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/nvim/os/shell.c') diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 32c7ea564d..8cf7e7161d 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -201,14 +201,14 @@ static int shell(const char *cmd, char **argv = shell_build_argv(cmd, extra_args); int status; - Job *job = job_start(argv, - &buf, - input != NULL, - data_cb, - data_cb, - NULL, - 0, - &status); + JobOptions opts = JOB_OPTIONS_INIT; + opts.argv = argv; + opts.data = &buf; + opts.writable = input != NULL; + opts.stdout_cb = data_cb; + opts.stderr_cb = data_cb; + opts.exit_cb = NULL; + Job *job = job_start(opts, &status); if (status <= 0) { // Failed, probably due to `sh` not being executable -- cgit