mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user