summaryrefslogtreecommitdiff
path: root/klm/util/scoped.cc
blob: 61394ffc2919f56d1198b0472672472e4dacb32f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "util/scoped.hh"

#include <err.h>
#include <unistd.h>

namespace util {

scoped_fd::~scoped_fd() {
  if (fd_ != -1 && close(fd_)) err(1, "Could not close file %i", fd_);
}

} // namespace util