Browse Source

FINAL final version

master
杨浩然 4 years ago
parent
commit
67250421bc
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      yeeshell.c

+ 3
- 2
yeeshell.c View File

@ -250,7 +250,6 @@ int do_pipe(char **pipe_arg_1, char **pipe_arg_2)
exit(0); exit(0);
} }
} }
waitpid(prog_1, NULL, 0);
if ((prog_2 = fork()) == 0) /* Child process 2 */ if ((prog_2 = fork()) == 0) /* Child process 2 */
{ {
@ -265,11 +264,13 @@ int do_pipe(char **pipe_arg_1, char **pipe_arg_2)
exit(0); exit(0);
} }
} }
waitpid(prog_2, NULL, 0);
close(fds[0]); close(fds[0]);
close(fds[1]); close(fds[1]);
waitpid(prog_1, NULL, 0);
waitpid(prog_2, NULL, 0);
return 1; return 1;
} }

Loading…
Cancel
Save