Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Fixes issue described in PR #17
Browse files Browse the repository at this point in the history
  • Loading branch information
eidheim committed Oct 10, 2016
1 parent 22b2436 commit 8025c45
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions process_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@ Process::id_type Process::open(const std::string &command, const std::string &pa

int stdin_p[2], stdout_p[2], stderr_p[2];

if(stdin_fd && pipe(stdin_p)!=0) {
close(stdin_p[0]);close(stdin_p[1]);
if(stdin_fd && pipe(stdin_p)!=0)
return -1;
}
if(stdout_fd && pipe(stdout_p)!=0) {
if(stdin_fd) {close(stdin_p[0]);close(stdin_p[1]);}
close(stdout_p[0]);close(stdout_p[1]);
return -1;
}
if(stderr_fd && pipe(stderr_p)!=0) {
if(stdin_fd) {close(stdin_p[0]);close(stdin_p[1]);}
if(stdout_fd) {close(stdout_p[0]);close(stdout_p[1]);}
close(stderr_p[0]);close(stderr_p[1]);
return -1;
}

Expand Down

0 comments on commit 8025c45

Please sign in to comment.