summaryrefslogtreecommitdiffstats
path: root/src/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/global.h')
-rw-r--r--src/global.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/global.h b/src/global.h
index a26c88b..ab4b24d 100644
--- a/src/global.h
+++ b/src/global.h
@@ -22,7 +22,7 @@ extern int verbose;
#define ALLOC_ERROR() do { ERROR("Cannot allocate memory"); } while (0)
#define ALLOC_ERROR_RETURN(...) do { ALLOC_ERROR(); return __VA_ARGS__; } while (0)
-#define SLEEP(usec) do { struct timespec _t = { 0, (usec) }; nanosleep(&_t, NULL); } while (0)
+#define MSLEEP(msec) do { nanosleep(&(struct timespec){ (msec / 1000), (1000L * 1000L * (msec % 1000)) }, NULL); } while (0)
static inline void * MEMMEM(void *haystack, size_t haystacklen, const void *needle, size_t needlelen) {
for ( size_t i = 0; i < haystacklen; ++i ) {