Modernize AutoCloseFD

This commit is contained in:
Shea Levy 2016-07-11 15:44:44 -04:00
parent 8a41792d43
commit cb5e7254b6
11 changed files with 139 additions and 153 deletions

View file

@ -325,7 +325,7 @@ RunPager::RunPager()
toPager.create();
pid = startProcess([&]() {
if (dup2(toPager.readSide, STDIN_FILENO) == -1)
if (dup2(toPager.readSide.get(), STDIN_FILENO) == -1)
throw SysError("dupping stdin");
if (!getenv("LESS"))
setenv("LESS", "FRSXMK", 1);
@ -337,7 +337,7 @@ RunPager::RunPager()
throw SysError(format("executing %1%") % pager);
});
if (dup2(toPager.writeSide, STDOUT_FILENO) == -1)
if (dup2(toPager.writeSide.get(), STDOUT_FILENO) == -1)
throw SysError("dupping stdout");
}