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