1 2 3 4 5 6 7 8 9
#include "unique_fd.hh" #include <unistd.h> void unique_fd::reset(int fd) { if (fd_ != -1) close(fd_); fd_ = fd; }