Changeset 8437


Ignore:
Timestamp:
May 19, 2009, 8:42:01 PM (12 years ago)
Author:
charles
Message:

(trunk libT) fix event_callback() error in tr-dht.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tr-dht.c

    r8436 r8437  
    361361event_callback(int s, short type, void *ignore UNUSED )
    362362{
    363     int rc;
    364363    time_t tosleep;
    365364    struct timeval tv;
    366365
    367     rc = dht_periodic(s, type == EV_READ, &tosleep, callback, NULL);
    368     if(rc < 0) {
     366    if( dht_periodic(s, type == EV_READ, &tosleep, callback, NULL) < 0 ) {
    369367        if(errno == EINTR) {
    370368            tosleep = 0;
    371369        } else {
    372370            perror("dht_periodic");
    373             if(rc == EINVAL || rc == EFAULT)
     371            if(errno == EINVAL || errno == EFAULT)
    374372                    abort();
    375373            tosleep = 1;
     
    377375    }
    378376
    379     /* Being slightly late is fine, and has the added benefit of adding
    380        some jitter. */
     377    /* Being slightly late is fine,
     378       and has the added benefit of adding some jitter. */
    381379    tv.tv_sec = tosleep;
    382380    tv.tv_usec = tr_cryptoWeakRandInt( 1000000 );
Note: See TracChangeset for help on using the changeset viewer.