From e475ff16004d9a7c76a01a71e6a52323e6bf1485 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 22 Jul 2015 15:49:34 -0700 Subject: [PATCH] Fix a compilation error. This regression was introduced by 1b0e4abbfdbcc1c1a71d1f617adb19951109bfce (Port mq_get() to MinGW.). --- test/src/mq.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/src/mq.c b/test/src/mq.c index d3377245..40b31c15 100644 --- a/test/src/mq.c +++ b/test/src/mq.c @@ -13,15 +13,17 @@ mq_nanosleep(unsigned ns) #ifdef _WIN32 Sleep(ns / 1000); #else - struct timespec timeout; + { + struct timespec timeout; - if (ns < 1000*1000*1000) { - timeout.tv_sec = 0; - timeout.tv_nsec = ns; - } else { - timeout.tv_sec = 1; - timeout.tv_nsec = 0; + if (ns < 1000*1000*1000) { + timeout.tv_sec = 0; + timeout.tv_nsec = ns; + } else { + timeout.tv_sec = 1; + timeout.tv_nsec = 0; + } + nanosleep(&timeout, NULL); } - nanosleep(&timeout, NULL); #endif }