1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 21:51:50 +02:00

Merge pull request #8887 from obsidiansystems/bsd-cross-ci

Support cross compiling to BSD and CI it
This commit is contained in:
John Ericson 2023-09-25 13:46:55 -04:00 committed by GitHub
commit 1f3fc08c59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 14 deletions

View file

@ -379,9 +379,9 @@ RunPager::RunPager()
});
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)
throw SysError("dupping stdout");
throw SysError("dupping standard output");
}
@ -390,7 +390,7 @@ RunPager::~RunPager()
try {
if (pid != -1) {
std::cout.flush();
dup2(stdout, STDOUT_FILENO);
dup2(std_out, STDOUT_FILENO);
pid.wait();
}
} catch (...) {

View file

@ -85,8 +85,9 @@ struct LegacyArgs : public MixCommonArgs
void showManPage(const std::string & name);
/**
* The constructor of this class starts a pager if stdout is a
* terminal and $PAGER is set. Stdout is redirected to the pager.
* The constructor of this class starts a pager if standard output is a
* terminal and $PAGER is set. Standard output is redirected to the
* pager.
*/
class RunPager
{
@ -96,7 +97,7 @@ public:
private:
Pid pid;
int stdout;
int std_out;
};
extern volatile ::sig_atomic_t blockInt;