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) 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. */

Loading…
Cancel
Save

Powered by TurnKey Linux.