Ignore:
Timestamp:
Feb 6, 2010, 2:43:28 PM (12 years ago)
Author:
charles
Message:

(trunk libT) when we can't bind to a port and the error is EADDRINUSE, add a parenthetical hint "(Is another copy of Transmission already running?)"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r10051 r10111  
    353353        const int err = sockerrno;
    354354        if( !suppressMsgs )
    355             tr_err( _( "Couldn't bind port %d on %s: %s" ),
    356                     port, tr_ntop_non_ts( addr ), tr_strerror( err ) );
     355        {
     356            const char * fmt;
     357            const char * hint;
     358
     359            if( err == EADDRINUSE )
     360                hint = _( "Is another copy of Transmission already running?" );
     361            else
     362                hint = NULL;
     363
     364            if( hint == NULL )
     365                fmt = _( "Couldn't bind port %d on %s: %s" );
     366            else
     367                fmt = _( "Couldn't bind port %d on %s: %s (%s)" );
     368           
     369            tr_err( fmt, port, tr_ntop_non_ts( addr ), tr_strerror( err ), hint );
     370        }
    357371        tr_netCloseSocket( fd );
    358372        *errOut = err;
Note: See TracChangeset for help on using the changeset viewer.