summaryrefslogtreecommitdiff
path: root/klm/util/scoped.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2010-12-13 16:18:34 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2010-12-13 16:18:34 -0500
commitbe98f29f51350c24136c191f01af3fbfe340ef78 (patch)
tree2e104152110ca76b527147458050a41934e031f2 /klm/util/scoped.cc
parent063c0623aaf5dad8d02e5eae5793c123cd7fc3fe (diff)
new version of kenlm
Diffstat (limited to 'klm/util/scoped.cc')
-rw-r--r--klm/util/scoped.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/klm/util/scoped.cc b/klm/util/scoped.cc
index 2c6d5394..a4cc5016 100644
--- a/klm/util/scoped.cc
+++ b/klm/util/scoped.cc
@@ -1,16 +1,24 @@
#include "util/scoped.hh"
-#include <err.h>
+#include <iostream>
+
+#include <stdlib.h>
#include <unistd.h>
namespace util {
scoped_fd::~scoped_fd() {
- if (fd_ != -1 && close(fd_)) err(1, "Could not close file %i", fd_);
+ if (fd_ != -1 && close(fd_)) {
+ std::cerr << "Could not close file " << fd_ << std::endl;
+ abort();
+ }
}
scoped_FILE::~scoped_FILE() {
- if (file_ && fclose(file_)) err(1, "Could not close file");
+ if (file_ && fclose(file_)) {
+ std::cerr << "Could not close file " << std::endl;
+ abort();
+ }
}
} // namespace util