Modification indentation
This commit is contained in:
parent
b507e1ef82
commit
8eb34f0307
1 changed files with 25 additions and 27 deletions
|
@ -53,14 +53,13 @@ int main()
|
||||||
dup2(my_pipe[0], STDIN_FILENO);
|
dup2(my_pipe[0], STDIN_FILENO);
|
||||||
else if (index == 0)
|
else if (index == 0)
|
||||||
dup2(my_pipe[1], STDOUT_FILENO);
|
dup2(my_pipe[1], STDOUT_FILENO);
|
||||||
close(my_pipe[0]);
|
//close(my_pipe[0]);
|
||||||
close(my_pipe[1]);
|
//close(my_pipe[1]);
|
||||||
|
|
||||||
execvp(args[0], args);
|
execvp(args[0], args);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (commands[index + 1] == NULL)
|
if (commands[index + 1] == NULL)
|
||||||
{
|
{
|
||||||
close(my_pipe[1]);
|
close(my_pipe[1]);
|
||||||
|
@ -68,7 +67,6 @@ int main()
|
||||||
waitpid(pid, NULL, 0);
|
waitpid(pid, NULL, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < MAX_LENGTH; i++)
|
for (int i = 0; i < MAX_LENGTH; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue