Ignore:
Timestamp:
Oct 3, 2008, 4:49:06 AM (13 years ago)
Author:
charles
Message:

(libT) finish killing tr_errno.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r6795 r6842  
    101101***/
    102102
    103 static tr_errno
     103/**
     104 * returns 0 on success, or an errno value on failure.
     105 * errno values include ENOENT if the parent folder doesn't exist,
     106 * plus the errno values set by tr_mkdirp() and open().
     107 */
     108static int
    104109TrOpenFile( int          i,
    105110            const char * folder,
     
    114119    /* confirm the parent folder exists */
    115120    if( stat( folder, &sb ) || !S_ISDIR( sb.st_mode ) )
    116         return TR_ERROR_IO_PARENT;
     121        return ENOENT;
    117122
    118123    /* create subfolders, if any */
     
    124129        tr_free( tmp );
    125130        if( err )
    126             return tr_ioErrorFromErrno( err );
     131            return err;
    127132    }
    128133
     
    141146        tr_err( _( "Couldn't open \"%1$s\": %2$s" ), filename,
    142147               tr_strerror( err ) );
    143         return tr_ioErrorFromErrno( err );
    144     }
    145 
    146     return TR_OK;
     148        return err;
     149    }
     150
     151    return 0;
    147152}
    148153
     
    173178}
    174179
     180/* returns an fd on success, or a -1 on failure and sets errno */
    175181int
    176182tr_fdFileCheckout( const char * folder,
     
    275281    if( !fileIsOpen( o ) )
    276282    {
    277         const tr_errno err = TrOpenFile( winner, folder, torrentFile, write );
    278         if( err )
    279         {
     283        const int err = TrOpenFile( winner, folder, torrentFile, write );
     284        if( err ) {
    280285            tr_lockUnlock( gFd->lock );
    281             return err;
     286            errno = err;
     287            return -1;
    282288        }
    283289
Note: See TracChangeset for help on using the changeset viewer.