From 970d9f7768a4c400ad26a7abb931da0d14e7e9ff Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 27 May 2015 01:09:51 +0000 Subject: [PATCH] Get thread sleep_for test passing in C++03 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238273 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../thread.threads/thread.thread.this/sleep_for.pass.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp index bffb5f38b..27e1d2a1d 100644 --- a/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp +++ b/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp @@ -17,14 +17,17 @@ #include #include #include +#include #include #include +void sig_action(int) {} + int main() { int ec; struct sigaction action; - action.sa_handler = [](int) {}; + action.sa_handler = &sig_action; sigemptyset(&action.sa_mask); action.sa_flags = 0; @@ -32,7 +35,7 @@ int main() assert(!ec); struct itimerval it; - it.it_interval = { 0 }; + std::memset(&it, 0, sizeof(itimerval)); it.it_value.tv_sec = 0; it.it_value.tv_usec = 250000; // This will result in a SIGALRM getting fired resulting in the nanosleep