fix inout.c read/write mode bug.

This commit is contained in:
Charles Kerr 2007-07-06 17:19:34 +00:00
parent bdeefc99b1
commit d8a6dd1e28
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ readOrWriteBytes ( const tr_torrent_t * tor,
if( !file->length )
return 0;
else if ((fd = tr_fdFileOpen ( tor->destination, file->name, TRUE )) < 0)
else if ((fd = tr_fdFileOpen ( tor->destination, file->name, ioMode==TR_IO_WRITE )) < 0)
ret = fd;
else if( lseek( fd, (off_t)fileOffset, SEEK_SET ) == ((off_t)-1) )
ret = TR_ERROR_IO_OTHER;