Преглед изворни кода

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

	Fixed error handling of lseek.
	* src/AbstractDiskWriter.cc
Tatsuhiro Tsujikawa пре 17 година
родитељ
комит
8503419ae3
2 измењених фајлова са 6 додато и 1 уклоњено
  1. 5 0
      ChangeLog
  2. 1 1
      src/AbstractDiskWriter.cc

+ 5 - 0
ChangeLog

@@ -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>
 
 	Removed "(1.x/2.x)" from TEXT_LOAD_COOKIES since aria2 can load Firefox3

+ 1 - 1
src/AbstractDiskWriter.cc

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