summaryrefslogtreecommitdiff
path: root/src/AbstractDiskWriter.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-25 23:38:36 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-25 23:38:36 +0900
commit52155b1860765c63a9a335f0467870ae4cc7a4d0 (patch)
tree93e6782324f5fc2de2a3dd8c4da3bf45082f3f7e /src/AbstractDiskWriter.cc
parent8865001f0112840d0f4cf370e55df26ff036cca3 (diff)
No retry for close() with EINTR. Also reverted changes in d5ffa253.
Diffstat (limited to 'src/AbstractDiskWriter.cc')
-rw-r--r--src/AbstractDiskWriter.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/AbstractDiskWriter.cc b/src/AbstractDiskWriter.cc
index 50f52701..11888bc0 100644
--- a/src/AbstractDiskWriter.cc
+++ b/src/AbstractDiskWriter.cc
@@ -59,10 +59,7 @@ AbstractDiskWriter::AbstractDiskWriter(const std::string& filename)
AbstractDiskWriter::~AbstractDiskWriter()
{
- try {
- closeFile();
- } catch(...) {
- }
+ closeFile();
}
void AbstractDiskWriter::openFile(off_t totalLength)
@@ -80,18 +77,9 @@ void AbstractDiskWriter::openFile(off_t totalLength)
void AbstractDiskWriter::closeFile()
{
- if(fd_ >= 0) {
- int r;
- while((r = close(fd_)) == -1 && errno == EINTR);
+ if(fd_ != -1) {
+ close(fd_);
fd_ = -1;
- if(r == -1) {
- int errNum = errno;
- throw DL_ABORT_EX3(errNum,
- fmt("Failed to close file %s, cause: %s",
- filename_.c_str(),
- util::safeStrerror(errNum).c_str()),
- error_code::FILE_IO_ERROR);
- }
}
}