mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +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:
@@ -132,14 +132,13 @@ uint64_t channel_from_job(char **argv)
|
||||
incref(channel); // job channels are only closed by the exit_cb
|
||||
|
||||
int status;
|
||||
channel->data.job = job_start(argv,
|
||||
channel,
|
||||
true,
|
||||
job_out,
|
||||
job_err,
|
||||
job_exit,
|
||||
0,
|
||||
&status);
|
||||
JobOptions opts = JOB_OPTIONS_INIT;
|
||||
opts.argv = argv;
|
||||
opts.data = channel;
|
||||
opts.stdout_cb = job_out;
|
||||
opts.stderr_cb = job_err;
|
||||
opts.exit_cb = job_exit;
|
||||
channel->data.job = job_start(opts, &status);
|
||||
|
||||
if (status <= 0) {
|
||||
if (status == 0) { // Two decrefs needed if status == 0.
|
||||
|
Reference in New Issue
Block a user