Changeset 10293


Ignore:
Timestamp:
Feb 27, 2010, 6:52:46 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2984 "Transmission 1.91/OSX deletes completed download" -- experimental commit, and more debug messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r10250 r10293  
    24252425};
    24262426
     2427static tr_bool
     2428sameInode( const char * path1, const char * path2 )
     2429{
     2430    int i1, i2;
     2431    struct stat s1, s2;
     2432
     2433    s1.st_ino = 1;
     2434    i1 = stat( path1, &s1 );
     2435
     2436    s2.st_ino = 2;
     2437    i2 = stat( path2, &s2 );
     2438
     2439    if( !i1 && !i2 ) {
     2440        tr_dbg( "path1 inode is %"PRIu64"; path2 inode is %"PRIu64,
     2441                (uint64_t)s1.st_ino,
     2442                (uint64_t)s2.st_ino );
     2443        return s1.st_ino == s2.st_ino;
     2444    }
     2445
     2446    /* either one, or the other, or both don't exist... */
     2447    tr_dbg( "stat(%s) returned %d\n", path1, i1 );
     2448    tr_dbg( "stat(%s) returned %d\n", path2, i2 );
     2449    return FALSE;
     2450}
     2451
    24272452static void
    24282453setLocation( void * vdata )
     
    24382463    assert( tr_isTorrent( tor ) );
    24392464
    2440     if( strcmp( location, tor->currentDir ) )
     2465    tr_dbg( "Moving \"%s\" location from currentDir \"%s\" to \"%s\"",
     2466            tr_torrentName(tor), tor->currentDir, location );
     2467
     2468    tr_mkdirp( location, 0777 );
     2469
     2470    if( !sameInode( location, tor->currentDir ) )
    24412471    {
    24422472        tr_file_index_t i;
     
    24652495                char * oldpath = tr_buildPath( oldbase, sub, NULL );
    24662496                char * newpath = tr_buildPath( location, sub, NULL );
     2497
     2498                tr_dbg( "Found file #%d: %s", (int)i, oldpath );
    24672499
    24682500                if( do_move )
Note: See TracChangeset for help on using the changeset viewer.