1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-12 07:03:44 +00:00

(trunk libT) portability improvements to tr_moveFile()

This commit is contained in:
Charles Kerr 2009-10-30 03:53:41 +00:00
parent ea072953c5
commit f5b97d43c9

View file

@ -1361,7 +1361,7 @@ tr_moveFile( const char * oldpath, const char * newpath, tr_bool * renamed )
int out; int out;
char * buf; char * buf;
struct stat st; struct stat st;
size_t bytesLeft; off_t bytesLeft;
size_t buflen; size_t buflen;
/* make sure the old file exists */ /* make sure the old file exists */
@ -1396,7 +1396,6 @@ tr_moveFile( const char * oldpath, const char * newpath, tr_bool * renamed )
/* copy the file */ /* copy the file */
in = tr_open_file_for_scanning( oldpath ); in = tr_open_file_for_scanning( oldpath );
tr_preallocate_file( newpath, bytesLeft );
out = tr_open_file_for_writing( newpath ); out = tr_open_file_for_writing( newpath );
buflen = stat( newpath, &st ) ? 4096 : st.st_blksize; buflen = stat( newpath, &st ) ? 4096 : st.st_blksize;
buf = tr_new( char, buflen ); buf = tr_new( char, buflen );