|
@@ -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);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|