|
|
|
@ -1010,12 +1010,16 @@ int start_subprocess(char *const command[], int *pid, int *infd, int *outfd)
|
|
|
|
if (!pid || !infd || !outfd)
|
|
|
|
if (!pid || !infd || !outfd)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (pipe(p1) == -1)
|
|
|
|
if (pipe(p1) == -1) {
|
|
|
|
goto err_pipe1;
|
|
|
|
printf("Error pipe1\n");
|
|
|
|
if (pipe(p2) == -1)
|
|
|
|
return 0;
|
|
|
|
goto err_pipe2;
|
|
|
|
} if (pipe(p2) == -1) {
|
|
|
|
if ((*pid = fork()) == -1)
|
|
|
|
printf("Error pipe2\n");
|
|
|
|
goto err_fork;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
} if ((*pid = fork()) == -1) {
|
|
|
|
|
|
|
|
printf("Error fork\n");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (*pid) {
|
|
|
|
if (*pid) {
|
|
|
|
/* Parent process. */
|
|
|
|
/* Parent process. */
|
|
|
|
|