diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c
index 8132ed1..905a19d 100644
a
|
b
|
TrOpenFile( tr_session * session, |
366 | 366 | |
367 | 367 | /* open the file */ |
368 | 368 | flags = doWrite ? ( O_RDWR | O_CREAT ) : O_RDONLY; |
369 | | #ifdef O_SEQUENTIAL |
370 | | flags |= O_SEQUENTIAL; |
371 | | #endif |
372 | 369 | #ifdef O_LARGEFILE |
373 | 370 | flags |= O_LARGEFILE; |
374 | 371 | #endif |
… |
… |
TrOpenFile( tr_session * session, |
395 | 392 | if( doWrite && !alreadyExisted && ( preallocationMode == TR_PREALLOCATE_SPARSE ) ) |
396 | 393 | preallocateFileSparse( file->fd, desiredFileSize ); |
397 | 394 | |
398 | | #ifdef HAVE_POSIX_FADVISE |
399 | | /* this doubles the OS level readahead buffer, which in practice |
400 | | * turns out to be a good thing, because many (most?) clients request |
401 | | * chunks of blocks in order. |
402 | | * It's okay for this to fail silently, so don't let it affect errno */ |
403 | | { |
404 | | const int err = errno; |
405 | | posix_fadvise( file->fd, 0, 0, POSIX_FADV_SEQUENTIAL ); |
406 | | errno = err; |
407 | | } |
408 | | #endif |
409 | | |
410 | 395 | return 0; |
411 | 396 | } |
412 | 397 | |