diff --git a/main.c b/main.c index e06c74f..f497d15 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: cchauvet cmds; while (current != NULL) { - content = current->content; - if (content->executable != NULL && content->own_cmd == 0 - && content->pid != -1 && content->fd_in[0] != -2 && content->fd_out[0] != -2) + cmd = current->content; + if (cmd->executable != NULL && cmd->own_cmd == 0 + && cmd->pid != -1 && cmd->fd_in[0] != -2 && cmd->fd_out[0] != -2) { - waitpid(content->pid, &exit_status, 0); + waitpid(cmd->pid, &exit_status, 0); if (WIFSIGNALED(exit_status)) { if (WTERMSIG(exit_status) == SIGKILL)