From e0ef743090038ee02d656cee11debd2246624ba0 Mon Sep 17 00:00:00 2001 From: redpony Date: Mon, 18 Oct 2010 23:24:01 +0000 Subject: kenneth's LM preliminary integration git-svn-id: https://ws10smt.googlecode.com/svn/trunk@681 ec762483-ff6d-05da-a07a-a48fb63a330f --- klm/util/scoped.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 klm/util/scoped.cc (limited to 'klm/util/scoped.cc') diff --git a/klm/util/scoped.cc b/klm/util/scoped.cc new file mode 100644 index 00000000..61394ffc --- /dev/null +++ b/klm/util/scoped.cc @@ -0,0 +1,12 @@ +#include "util/scoped.hh" + +#include +#include + +namespace util { + +scoped_fd::~scoped_fd() { + if (fd_ != -1 && close(fd_)) err(1, "Could not close file %i", fd_); +} + +} // namespace util -- cgit v1.2.3