From 9dd8c2af44dc79101c4fc07ced60c38e76e25045 Mon Sep 17 00:00:00 2001 From: pwpiwi Date: Fri, 6 Mar 2020 17:35:59 +0100 Subject: [PATCH] a simpler fix. Force POSIX compliance --- client/comms.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/client/comms.c b/client/comms.c index b4091e00..1391641d 100644 --- a/client/comms.c +++ b/client/comms.c @@ -9,6 +9,8 @@ // Code for communicating with the proxmark3 hardware. //----------------------------------------------------------------------------- +#define _POSIX_C_SOURCE 199309L // need clock_gettime() + #include "comms.h" #include @@ -145,14 +147,7 @@ static void storeCommand(UsbCommand *command) { static int getCommand(UsbCommand* response, uint32_t ms_timeout) { struct timespec end_time; -#if (_POSIX_TIMERS > 0) clock_gettime(CLOCK_REALTIME, &end_time); -#else - struct timeval tv; - gettimeofday(&tv, NULL); - end_time.tv_sec = tv.tv_sec; - end_time.tv_nsec = tv.tv_usec * 1000; -#endif end_time.tv_sec += ms_timeout / 1000; end_time.tv_nsec += (ms_timeout % 1000) * 1000000; if (end_time.tv_nsec > 1000000000) {