Ignore:
Timestamp:
Feb 2, 2011, 11:19:54 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) #3973 "JIT verification verifies fresh downloaded torrents" -- win32 portability fix for r11813.

fsync() doesn't exist on Windows. bencode had a private function, tr_fsync(), that is a portability wrapper around fsync() on *nix and _commit() on win32. Make this function package-visible, rather than private, so fdlimit.c can use it too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r11813 r11816  
    181181}
    182182
     183
     184/* portability wrapper for fsync(). */
     185int
     186tr_fsync( int fd )
     187{
     188#ifdef WIN32
     189    return _commit( fd );
     190#else
     191    return fsync( fd );
     192#endif
     193}
     194
     195
    183196/* Like pread and pwrite, except that the position is undefined afterwards.
    184197   And of course they are not thread-safe. */
     
    296309    fcntl( fd, F_NOCACHE, 1 );
    297310#endif
    298     fsync( fd );
     311    tr_fsync( fd );
    299312    close( fd );
    300313}
Note: See TracChangeset for help on using the changeset viewer.