From ae161ac2394e00bb3afca0667a13243d7963dfe2 Mon Sep 17 00:00:00 2001 From: davidxu Date: Fri, 4 Nov 2005 09:41:00 +0000 Subject: Fix name compatible problem with POSIX standard. the sigval_ptr and sigval_int really should be sival_ptr and sival_int. Also sigev_notify_function accepts a union sigval value but not a pointer. --- lib/libthr/thread/thr_timer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libthr/thread/thr_timer.c') diff --git a/lib/libthr/thread/thr_timer.c b/lib/libthr/thread/thr_timer.c index de8fad1..80e4bd0 100644 --- a/lib/libthr/thread/thr_timer.c +++ b/lib/libthr/thread/thr_timer.c @@ -47,7 +47,7 @@ struct thread_node { struct timer { union sigval value; - void (*function)(union sigval *, int); + void (*function)(union sigval, int); int timerid; long flags; int gen; @@ -122,7 +122,7 @@ __timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) * Here we pass second parameter an overrun count, this is * not required by POSIX. */ - tmr->function = (void (*)(union sigval *, int)) + tmr->function = (void (*)(union sigval, int)) evp->sigev_notify_function; tmr->flags = 0; tmr->timerid = -1; @@ -147,7 +147,7 @@ __timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) ev.sigev_notify = SIGEV_THREAD_ID; ev.sigev_signo = SIGTIMER; ev.sigev_notify_thread_id = (lwpid_t)tmr->tn->thread->tid; - ev.sigev_value.sigval_int = tmr->gen; + ev.sigev_value.sival_int = tmr->gen; ret = __sys_timer_create(clockid, &ev, &tmr->timerid); if (__predict_false(ret != 0 || register_timer(tmr) != 0)) { ret = errno; @@ -355,11 +355,11 @@ service_loop(void *arg) TIMERS_LOCK(curthread); if (si.si_timerid >= 0 && si.si_timerid < timer_max && (tmr = timer_list[si.si_timerid]) != NULL && - si.si_value.sigval_int == tmr->gen) { + si.si_value.sival_int == tmr->gen) { tmr->flags |= WORKING; TIMERS_UNLOCK(curthread); tn->curtmr = tmr; - tmr->function(&tmr->value, si.si_overrun); + tmr->function(tmr->value, si.si_overrun); tn->curtmr = NULL; TIMERS_LOCK(curthread); tmr->flags &= ~WORKING; -- cgit v1.1