Changeset 1207
- Timestamp:
- Dec 14, 2006, 4:25:35 AM (16 years ago)
- Location:
- branches/io/libtransmission
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/io/libtransmission/fdlimit.c
r1206 r1207 199 199 200 200 open: 201 tr_dbg( "Opening %s in %s ", name, folder);201 tr_dbg( "Opening %s in %s (%d)", name, folder, write ); 202 202 asprintf( &path, "%s/%s", folder, name ); 203 203 f->open[winner].file = open( path, write ? ( O_RDWR | O_CREAT ) : … … 362 362 static void CloseFile( tr_fd_t * f, int i ) 363 363 { 364 if( !( f->open[i].status & STATUS_UNUSED ) ) 364 tr_openFile_t * file = &f->open[i]; 365 if( !( file->status & STATUS_UNUSED ) ) 365 366 { 366 367 tr_err( "CloseFile: status is %d, should be %d", 367 f ->open[i].status, STATUS_UNUSED );368 } 369 tr_dbg( "Closing %s in %s ", f->open[i].name, f->open[i].folder);370 f ->open[i].status = STATUS_CLOSING;371 tr_lockUnlock( &f->lock ); 372 close( f ->open[i].file );373 tr_lockLock( &f->lock ); 374 f ->open[i].status = STATUS_INVALID;368 file->status, STATUS_UNUSED ); 369 } 370 tr_dbg( "Closing %s in %s (%d)", file->name, file->folder, file->write ); 371 file->status = STATUS_CLOSING; 372 tr_lockUnlock( &f->lock ); 373 close( file->file ); 374 tr_lockLock( &f->lock ); 375 file->status = STATUS_INVALID; 375 376 tr_condSignal( &f->cond ); 376 377 } -
branches/io/libtransmission/inout.c
r1205 r1207 382 382 if( lseek( file, offset, SEEK_SET ) < 0 ) 383 383 { 384 tr_fdFileRelease( tor->fdlimit, file ); 384 385 goto fail; 385 386 } … … 388 389 if( readOrWrite( file, buf, cur ) != cur ) 389 390 { 391 tr_fdFileRelease( tor->fdlimit, file ); 390 392 goto fail; 391 393 }
Note: See TracChangeset
for help on using the changeset viewer.