return fds;
}
-template<class Runnable>
+template <class Runnable>
void checkFdLeak(const Runnable& r) {
// Get the currently open fds. Check that they are the same both before and
// after calling the specified function. We read the open fds from /proc.
: public Subprocess::DangerousPostForkPreExecCallback {
explicit WriteFileAfterFork(std::string filename)
: filename_(std::move(filename)) {}
- virtual ~WriteFileAfterFork() {}
+ ~WriteFileAfterFork() override {}
int operator()() override {
return writeFile(std::string("ok"), filename_.c_str()) ? 0 : errno;
}
return (n == 0);
}
-} // namespace
+} // namespace
TEST(CommunicateSubprocessTest, Chatty) {
checkFdLeak([] {