all: Use nanosleep (via SLEEP) instead usleep

This commit is contained in:
Pali Rohár committed 2014-11-26 15:46:03 +01:00
1 parent a9b1332f8f
commit bc9f42f559
4 files changed
+13 -10

No files matched your search

+3
View File
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <time.h>
extern int simulate;
extern int noverify;
@@ -21,4 +22,6 @@ 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)
#endif