Skip to content

Commit

Permalink
Merge pull request mozart#281 from layus/fix-dup
Browse files Browse the repository at this point in the history
Use dup2 to remove warnings and explicit the intent
  • Loading branch information
layus authored Sep 19, 2016
2 parents 0b50284 + 516dc42 commit 7f83066
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vm/boostenv/main/modos.hh
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,8 @@ public:
raiseLastOSError(vm, "open");
}

dup(dn); // stdout
dup(dn); // stderr
dup2(dn, 1); // stdout
dup2(dn, 2); // stderr
}
#endif

Expand Down Expand Up @@ -1090,9 +1090,9 @@ public:
close(i);
}
}
dup(socketHandle);
dup(socketHandle);
dup(socketHandle);
dup2(socketHandle, 0); // stdin
dup2(socketHandle, 1); // stdout
dup2(socketHandle, 2); // stderr

auto c_executable = executable.string;
auto c_argv = new char*[argc+1];
Expand Down

0 comments on commit 7f83066

Please sign in to comment.