Changeset 9362 for branches/1.7x/libtransmission/torrent.c
- Timestamp:
- Oct 22, 2009, 2:40:22 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.7x/libtransmission/torrent.c
r9361 r9362 2307 2307 setLocation( void * vdata ) 2308 2308 { 2309 int err = 0; 2309 tr_bool err = FALSE; 2310 tr_bool verify_needed = FALSE; 2310 2311 struct LocationData * data = vdata; 2311 2312 tr_torrent * tor = data->tor; … … 2345 2346 errno = 0; 2346 2347 tr_torinf( tor, "moving \"%s\" to \"%s\"", oldpath, newpath ); 2347 if( tr_moveFile( oldpath, newpath ) ) { 2348 err = 1; 2349 tr_torerr( tor, "error moving \"%s\" to \"%s\": %s", 2350 oldpath, newpath, tr_strerror( errno ) ); 2348 if( rename( oldpath, newpath ) ) 2349 { 2350 verify_needed = TRUE; 2351 if( tr_moveFile( oldpath, newpath ) ) 2352 { 2353 err = TRUE; 2354 tr_torerr( tor, "error moving \"%s\" to \"%s\": %s", 2355 oldpath, newpath, tr_strerror( errno ) ); 2356 } 2351 2357 } 2352 2358 } … … 2369 2375 { 2370 2376 /* blow away the leftover subdirectories in the old location */ 2371 if( do_move )2377 if( do_move && verify_needed ) 2372 2378 tr_torrentDeleteLocalData( tor, remove ); 2373 2379 2374 2380 /* set the new location and reverify */ 2375 2381 tr_torrentSetDownloadDir( tor, location ); 2376 tr_torrentVerify( tor ); 2382 if( verify_needed ) 2383 tr_torrentVerify( tor ); 2377 2384 } 2378 2385 }
Note: See TracChangeset
for help on using the changeset viewer.