summaryrefslogtreecommitdiff
path: root/src/AbstractDiskWriter.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-01-05 16:01:46 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-01-05 16:01:46 +0000
commit4db349c1f32b4a313d12d114137432441633d00a (patch)
tree417451971e264834312cfd8339c79930d680a5d1 /src/AbstractDiskWriter.cc
parent338e8aca09331d3e7fa4e1e8e1f9d10260986772 (diff)
2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
Diffstat (limited to 'src/AbstractDiskWriter.cc')
-rw-r--r--src/AbstractDiskWriter.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/AbstractDiskWriter.cc b/src/AbstractDiskWriter.cc
index 78e9ffed..84a5f3bd 100644
--- a/src/AbstractDiskWriter.cc
+++ b/src/AbstractDiskWriter.cc
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
@@ -110,9 +110,9 @@ void AbstractDiskWriter::createFile(int addFlags)
assert(!_filename.empty());
util::mkdirs(File(_filename).getDirname());
if((fd = open(_filename.c_str(), O_CREAT|O_RDWR|O_TRUNC|O_BINARY|addFlags,
- OPEN_MODE)) < 0) {
+ OPEN_MODE)) < 0) {
throw DL_ABORT_EX(StringFormat(EX_FILE_OPEN,
- _filename.c_str(), strerror(errno)).str());
+ _filename.c_str(), strerror(errno)).str());
}
}
@@ -153,10 +153,10 @@ void AbstractDiskWriter::writeData(const unsigned char* data, size_t len, off_t
// DownloadFailureException and abort download instantly.
if(errno == ENOSPC) {
throw DOWNLOAD_FAILURE_EXCEPTION
- (StringFormat(EX_FILE_WRITE, _filename.c_str(), strerror(errno)).str());
+ (StringFormat(EX_FILE_WRITE, _filename.c_str(), strerror(errno)).str());
}
throw DL_ABORT_EX(StringFormat(EX_FILE_WRITE,
- _filename.c_str(), strerror(errno)).str());
+ _filename.c_str(), strerror(errno)).str());
}
}
@@ -166,7 +166,7 @@ ssize_t AbstractDiskWriter::readData(unsigned char* data, size_t len, off_t offs
seek(offset);
if((ret = readDataInternal(data, len)) < 0) {
throw DL_ABORT_EX(StringFormat(EX_FILE_READ,
- _filename.c_str(), strerror(errno)).str());
+ _filename.c_str(), strerror(errno)).str());
}
return ret;
}
@@ -183,12 +183,12 @@ void AbstractDiskWriter::truncate(uint64_t length)
seek(length);
if(SetEndOfFile(handle) == 0) {
throw DL_ABORT_EX(StringFormat("SetEndOfFile failed. cause: %s",
- GetLastError()).str());
+ GetLastError()).str());
}
#else
if(ftruncate(fd, length) == -1) {
throw DL_ABORT_EX(StringFormat("ftruncate failed. cause: %s",
- strerror(errno)).str());
+ strerror(errno)).str());
}
#endif
}
@@ -202,7 +202,7 @@ void AbstractDiskWriter::allocate(off_t offset, uint64_t length)
int r = posix_fallocate(fd, offset, length);
if(r != 0) {
throw DL_ABORT_EX(StringFormat("posix_fallocate failed. cause: %s",
- strerror(r)).str());
+ strerror(r)).str());
}
}
#endif // HAVE_POSIX_FALLOCATE