1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

hurd: fix warning

timer_ptr2id and timer_id2ptr are used to convert between
application-visible timer_t and struct timer_node *. timer_ptr2id was made
to use void * instead of timer_t in 49b650430e ('Update.') for no reason.
It happens that on Linux timer_t is void *, so both that change and this
commit are no-ops there, but not on systems where timer_t is not void *.

Using timer_ptr2id for filling sival_ptr also does not make sense since that
actually is a void *.

	* sysdeps/pthread/posix-timer.h (timer_ptr2id): Cast to timer_t
	instead of void *.
	* sysdeps/pthread/timer_create.c (timer_create): Do not use
	timer_ptr2id to cast struct timer_node * to void *.
This commit is contained in:
Samuel Thibault
2018-01-27 17:17:49 +01:00
parent 05ebfe87fa
commit 61a3a8c6ce
3 changed files with 6 additions and 2 deletions

View File

@ -77,7 +77,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
{
newtimer->event.sigev_notify = SIGEV_SIGNAL;
newtimer->event.sigev_signo = SIGALRM;
newtimer->event.sigev_value.sival_ptr = timer_ptr2id (newtimer);
newtimer->event.sigev_value.sival_ptr = newtimer;
newtimer->event.sigev_notify_function = 0;
}