Changeset 11480


Ignore:
Timestamp:
Dec 5, 2010, 6:58:26 PM (11 years ago)
Author:
charles
Message:

(2.0x libtransmission) backport r11300 for #3614 "Can't save benc files under uClibc 0.9.31"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/libtransmission/bencode.c

    r10634 r11480  
    16401640        if( write( fd, str, len ) == (ssize_t)len )
    16411641        {
     1642            struct stat sb;
     1643            const tr_bool already_exists = !stat( filename, &sb ) && S_ISREG( sb.st_mode );
     1644
    16421645            fsync( fd );
    16431646            close( fd );
    16441647
    1645             if( !unlink( filename ) || ( errno == ENOENT ) )
     1648            if( !already_exists || !unlink( filename ) )
    16461649            {
    16471650                tr_dbg( "Renaming \"%s\" as \"%s\"", tmp, filename );
Note: See TracChangeset for help on using the changeset viewer.