Navigation


Changeset 1059:a1d6e1980132 in freeDiameter


Ignore:
Timestamp:
May 10, 2013, 10:50:09 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix fifo_tget to propagate any error returned by the posix call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/fifo.c

    r974 r1059  
    489489static int fifo_tget ( struct fifo * queue, void ** item, int istimed, const struct timespec *abstime)
    490490{
    491         int timedout = 0;
    492491        int call_cb = 0;
     492        int ret = 0;
    493493       
    494494        /* Check the parameters */
     
    515515                call_cb = test_l_cb(queue);
    516516        } else {
    517                 int ret = 0;
    518517                /* We have to wait for a new item */
    519518                queue->thrs++ ;
     
    529528                        goto awaken;  /* test for spurious wake-ups */
    530529               
    531                 if (istimed && (ret == ETIMEDOUT)) {
    532                         timedout = 1;
    533                 } else {
    534                         /* Unexpected error condition (means we need to debug) */
    535                         ASSERT( ret == 0 /* never true */ );
    536                 }
     530                /* otherwise (ETIMEDOUT / other error) just continue */
    537531        }
    538532       
     
    545539       
    546540        /* Done */
    547         return timedout ? ETIMEDOUT : 0;
     541        return ret;
    548542}
    549543
Note: See TracChangeset for help on using the changeset viewer.