mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
Rename an identifier of ours called stdout
This is a reserved identifier on NetBSD --- it is replaced by a macro on that platform --- and so we cannot use it.
This commit is contained in:
parent
0db251e4ad
commit
7f76d7f038
2 changed files with 7 additions and 6 deletions
|
@ -379,9 +379,9 @@ RunPager::RunPager()
|
||||||
});
|
});
|
||||||
|
|
||||||
pid.setKillSignal(SIGINT);
|
pid.setKillSignal(SIGINT);
|
||||||
stdout = fcntl(STDOUT_FILENO, F_DUPFD_CLOEXEC, 0);
|
std_out = fcntl(STDOUT_FILENO, F_DUPFD_CLOEXEC, 0);
|
||||||
if (dup2(toPager.writeSide.get(), STDOUT_FILENO) == -1)
|
if (dup2(toPager.writeSide.get(), STDOUT_FILENO) == -1)
|
||||||
throw SysError("dupping stdout");
|
throw SysError("dupping standard output");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ RunPager::~RunPager()
|
||||||
try {
|
try {
|
||||||
if (pid != -1) {
|
if (pid != -1) {
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
dup2(stdout, STDOUT_FILENO);
|
dup2(std_out, STDOUT_FILENO);
|
||||||
pid.wait();
|
pid.wait();
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
|
@ -85,8 +85,9 @@ struct LegacyArgs : public MixCommonArgs
|
||||||
void showManPage(const std::string & name);
|
void showManPage(const std::string & name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constructor of this class starts a pager if stdout is a
|
* The constructor of this class starts a pager if standard output is a
|
||||||
* terminal and $PAGER is set. Stdout is redirected to the pager.
|
* terminal and $PAGER is set. Standard output is redirected to the
|
||||||
|
* pager.
|
||||||
*/
|
*/
|
||||||
class RunPager
|
class RunPager
|
||||||
{
|
{
|
||||||
|
@ -96,7 +97,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Pid pid;
|
Pid pid;
|
||||||
int stdout;
|
int std_out;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern volatile ::sig_atomic_t blockInt;
|
extern volatile ::sig_atomic_t blockInt;
|
||||||
|
|
Loading…
Reference in a new issue