Skip to content

Commit

Permalink
Fix compilation when stdout is a macro
Browse files Browse the repository at this point in the history
  • Loading branch information
corngood committed Dec 22, 2021
1 parent 5ef3e2f commit 4220db4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libmain/shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ RunPager::RunPager()
});

pid.setKillSignal(SIGINT);
stdout = fcntl(STDOUT_FILENO, F_DUPFD_CLOEXEC, 0);
out = fcntl(STDOUT_FILENO, F_DUPFD_CLOEXEC, 0);
if (dup2(toPager.writeSide.get(), STDOUT_FILENO) == -1)
throw SysError("dupping stdout");
}
Expand All @@ -438,7 +438,7 @@ RunPager::~RunPager()
try {
if (pid != -1) {
std::cout.flush();
dup2(stdout, STDOUT_FILENO);
dup2(out, STDOUT_FILENO);
pid.wait();
}
} catch (...) {
Expand Down
2 changes: 1 addition & 1 deletion src/libmain/shared.hh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public:

private:
Pid pid;
int stdout;
int out;
};

extern volatile ::sig_atomic_t blockInt;
Expand Down

0 comments on commit 4220db4

Please sign in to comment.