[CRIU] [PATCH] zdtm: check posix_timer with sival_ptr = NULL
Andrey Vagin
avagin at openvz.org
Sat Mar 8 10:58:54 PST 2014
Here is a regresion test cae for
commit 1934e1a9638cdb8cd546cd0499fe7804317593d8
Author: Andrey Vagin <avagin at 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: Andrey Vagin <avagin at openvz.org>
---
test/zdtm/live/static/posix_timers.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/zdtm/live/static/posix_timers.c b/test/zdtm/live/static/posix_timers.c
index 75b174e..c9dbda9 100644
--- a/test/zdtm/live/static/posix_timers.c
+++ b/test/zdtm/live/static/posix_timers.c
@@ -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");
--
1.8.5.3
More information about the CRIU
mailing list