2008-08-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed error handling of lseek.
	* src/AbstractDiskWriter.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-08-23 14:59:04 +00:00
parent 7e8565f82e
commit 8503419ae3
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-08-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed error handling of lseek.
* src/AbstractDiskWriter.cc
2008-08-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> 2008-08-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "(1.x/2.x)" from TEXT_LOAD_COOKIES since aria2 can load Firefox3 Removed "(1.x/2.x)" from TEXT_LOAD_COOKIES since aria2 can load Firefox3

View File

@ -124,7 +124,7 @@ ssize_t AbstractDiskWriter::readDataInternal(unsigned char* data, size_t len)
void AbstractDiskWriter::seek(off_t offset) void AbstractDiskWriter::seek(off_t offset)
{ {
if(offset != lseek(fd, offset, SEEK_SET)) { if(lseek(fd, offset, SEEK_SET) == (off_t)-1) {
throw DlAbortEx throw DlAbortEx
(StringFormat(EX_FILE_SEEK, filename.c_str(), strerror(errno)).str()); (StringFormat(EX_FILE_SEEK, filename.c_str(), strerror(errno)).str());
} }