Commit 485766bc authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: check posix_timer with sival_ptr = NULL

Here is a regresion test cae for

commit 1934e1a9
Author: Andrey Vagin <avagin@openvz.org>
Date:   Tue Feb 18 16:53:00 2014 +0400

    posix-timer: take into account that sival_ptr can be NULL (v3)
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8d8d6384
......@@ -171,6 +171,9 @@ static void generic_handler(struct posix_timers_info *info,
{
int overrun;
if (info == NULL)
info = &posix_timers[MONOTONIC_ONESHOT_INFO];
if (info != real) {
real->handler_status |= WRONG_SI_PTR;
return;
......@@ -262,7 +265,10 @@ static int setup_timers(void)
sev.sigev_notify = SIGEV_SIGNAL;
sev.sigev_signo = info->sig;
sev.sigev_value.sival_ptr = info;
if (&posix_timers[MONOTONIC_ONESHOT_INFO] == info)
sev.sigev_value.sival_ptr = NULL;
else
sev.sigev_value.sival_ptr = info;
if (timer_create(info->clock, &sev, &info->timerid) == -1) {
err("Can't create timer\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment