|
@ -28,15 +28,13 @@ int caller(t_command *cmd) |
|
|
} |
|
|
} |
|
|
pid = fork(); |
|
|
pid = fork(); |
|
|
if (!pid) |
|
|
if (!pid) |
|
|
{ |
|
|
|
|
|
if (command_call(cmd->argv) == -1) |
|
|
|
|
|
{ |
|
|
{ |
|
|
if (cmd->fd[0]) |
|
|
if (cmd->fd[0]) |
|
|
dup2(cmd->fd[0], STDIN_FILENO); |
|
|
dup2(cmd->fd[0], STDIN_FILENO); |
|
|
if (cmd->fd[1]) |
|
|
if (cmd->fd[1]) |
|
|
dup2(cmd->fd[1], STDOUT_FILENO); |
|
|
dup2(cmd->fd[1], STDOUT_FILENO); |
|
|
|
|
|
if (command_call(cmd->argv) == -1) |
|
|
exe(cmd->argv, cmd->envp); |
|
|
exe(cmd->argv, cmd->envp); |
|
|
} |
|
|
|
|
|
exit(1); |
|
|
exit(1); |
|
|
} |
|
|
} |
|
|
if (cmd->fd[1]) |
|
|
if (cmd->fd[1]) |
|
|