The small fixes that were made in the corrections
This commit is contained in:
parent
81d1cc2ad1
commit
2bbd0ff867
3 changed files with 6 additions and 5 deletions
|
|
@ -59,7 +59,7 @@ void _wait_pipeline(t_vec_pid pids, t_state *state, t_pipeline_result *out)
|
|||
if (WIFEXITED(waitpid_status))
|
||||
out->exit = WEXITSTATUS(waitpid_status);
|
||||
if (WIFSIGNALED(waitpid_status))
|
||||
out->exit = WTERMSIG(waitpid_status);
|
||||
out->exit = WTERMSIG(waitpid_status) + 128;
|
||||
}
|
||||
else
|
||||
out->exit = 127;
|
||||
|
|
@ -131,11 +131,11 @@ t_error run_pipeline(t_ast_pipeline *pipeline, t_state *state,
|
|||
cpipe.create_output = i < pipeline->statements.len - 1;
|
||||
child = pipeline->statements.buffer[i++];
|
||||
if (child->kind == AST_COMMAND)
|
||||
ret |= _pipeline_cmd(child, state, &cpipe, &pids);
|
||||
ret = _pipeline_cmd(child, state, &cpipe, &pids);
|
||||
else if (child->kind == AST_SUBSHELL)
|
||||
ret |= _subshell_cmd(child, state, &cpipe, &pids);
|
||||
ret = _subshell_cmd(child, state, &cpipe, &pids);
|
||||
else
|
||||
ret |= ((void)(printf("List in pipelines are unsupported,"\
|
||||
ret = ((void)(printf("List in pipelines are unsupported,"\
|
||||
" use a subshell !\n")), ERROR);
|
||||
}
|
||||
return (_wait_pipeline(pids, state, out), ret);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ t_error run_subshell(t_ast_subshell *subshell, t_state *state,
|
|||
if (subshell == NULL || state == NULL || out == NULL)
|
||||
return (ERROR);
|
||||
mem_set_zero(&sinfo, sizeof(sinfo));
|
||||
mem_set_zero(&info, sizeof(info));
|
||||
sinfo.state = state;
|
||||
if (_setup_redirection(&info, state, cmd_pipe, \
|
||||
&subshell->suffixes_redirections))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue