Changes in libfdproto/fifo.c [1093:44f3e48dfe27:1104:757df62cadb6] in freeDiameter
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/fifo.c
r1093 r1104 412 412 CHECK_MALLOC_DO( new = malloc (sizeof (struct fifo_item)) , { 413 413 pthread_mutex_unlock( &queue->mtx ); 414 return ENOMEM; 414 415 } ); 415 416 … … 470 471 ASSERT( ! FD_IS_LIST_EMPTY(&queue->list) ); 471 472 472 fi = (struct fifo_item *)queue->list.next; 473 fi = (struct fifo_item *)(queue->list.next); 474 ret = fi->item.o; 473 475 fd_list_unlink(&fi->item); 474 476 queue->count--; 475 477 queue->total_items++; 476 ret = fi->item.o;477 478 478 479 /* Update the timings */ … … 578 579 static int fifo_tget ( struct fifo * queue, void ** item, int istimed, const struct timespec *abstime) 579 580 { 580 int timedout = 0;581 581 int call_cb = 0; 582 int ret = 0; 582 583 583 584 /* Check the parameters */ … … 598 599 return EPIPE; 599 600 } 600 601 601 602 if (queue->count > 0) { 602 603 /* There are items in the queue, so pick the first one */ … … 604 605 call_cb = test_l_cb(queue); 605 606 } else { 606 int ret = 0;607 607 /* We have to wait for a new item */ 608 608 queue->thrs++ ; … … 618 618 goto awaken; /* test for spurious wake-ups */ 619 619 620 if (istimed && (ret == ETIMEDOUT)) { 621 timedout = 1; 622 } else { 623 /* Unexpected error condition (means we need to debug) */ 624 ASSERT( ret == 0 /* never true */ ); 625 } 620 /* otherwise (ETIMEDOUT / other error) just continue */ 626 621 } 627 622 … … 634 629 635 630 /* Done */ 636 return timedout ? ETIMEDOUT : 0;631 return ret; 637 632 } 638 633
Note: See TracChangeset
for help on using the changeset viewer.