Changeset f959a20f in mainline for uspace/lib/posix/src/signal.c


Ignore:
Timestamp:
2019-02-01T22:32:38Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
00b7fc8
Parents:
1a37496
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 21:22:39)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 22:32:38)
Message:

Avoid directly using .head/.next/.prev of list_t/link_t

Use existing constructs from <adt/list.h> instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/signal.c

    r1a37496 rf959a20f  
    383383static void _dequeue_unblocked_signals(void)
    384384{
    385         link_t *iterator = _signal_queue.head.next;
    386         link_t *next;
    387 
    388         while (iterator != &(_signal_queue).head) {
    389                 next = iterator->next;
    390 
     385        list_foreach_safe(_signal_queue, cur_link, next_link) {
    391386                signal_queue_item *item =
    392                     list_get_instance(iterator, signal_queue_item, link);
     387                    list_get_instance(cur_link, signal_queue_item, link);
    393388
    394389                if (!sigismember(&_signal_mask, item->signo) &&
    395390                    _signal_actions[item->signo].sa_handler != SIG_HOLD) {
    396                         list_remove(&(item->link));
    397                         _raise_sigaction(item->signo, &(item->siginfo));
     391                        list_remove(cur_link);
     392                        _raise_sigaction(item->signo, &item->siginfo);
    398393                        free(item);
    399394                }
    400 
    401                 iterator = next;
    402395        }
    403396}
Note: See TracChangeset for help on using the changeset viewer.