mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk libT) #3975 "tr_bencToFile() contains unnecessary calls to stat() and unlink()" -- fixed for win32.
remove() doesn't have the same behavior on Windows. On that platform, we should use MoveFileEx( oldpath, newpath, MOVEFILE_REPLACE_EXISTING )." Thanks to rb07 for testing & confirming the fix.
This commit is contained in:
parent
24b9dc7dc2
commit
ce08e00e2e
1 changed files with 4 additions and 0 deletions
|
@ -1707,7 +1707,11 @@ tr_bencToFile( const tr_benc * top, tr_fmt_mode mode, const char * filename )
|
|||
tr_fsync( fd );
|
||||
tr_close_file( fd );
|
||||
|
||||
#ifdef WIN32
|
||||
if( MoveFileEx( tmp, filename, MOVEFILE_REPLACE_EXISTING ) )
|
||||
#else
|
||||
if( !rename( tmp, filename ) )
|
||||
#endif
|
||||
{
|
||||
tr_inf( _( "Saved \"%s\"" ), filename );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue