handled errors

pull/78/head
alanbjohnston 5 years ago committed by GitHub
parent 4ee4fe7847
commit 203f9cee90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save

Powered by TurnKey Linux.