Commit 84acf4ff authored by abenoit's avatar abenoit
Browse files

subprocesses return values

parent a7c8219d
......@@ -63,7 +63,11 @@ int parent_pipe_end(t_command *cur_command, t_xe *xe, int fd_in, int proc)
i = 0;
while (i < proc)
{
wait(NULL);
wait(&xe->stat_loc);
if (WIFSIGNALED(xe->stat_loc)) // check this return value!
{
xe->stat_loc += 128;
}
i++;
}
if (ret != SUCCESS)
......
......@@ -104,7 +104,11 @@ static int launch_ext(char **args, t_xe *xe)
signal(SIGQUIT, SIG_IGN);
waitpid(pid, &xe->stat_loc, 0); // return value? error?
free_str_array(path);
if (xe->stat_loc > 256)
if (WIFSIGNALED(xe->stat_loc)) // check this return value
{
xe->stat_loc = 128 + WTERMSIG(xe->stat_loc);
}
else if (xe->stat_loc > 256)
xe->stat_loc = xe->stat_loc / 256;
signal_handler();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment