Commit 77027d49 authored by Jan Včelák's avatar Jan Včelák 🚀

tests: use clock_nanosleep instead of empty select

parent a68c6d2a
......@@ -21,6 +21,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <tap/basic.h>
#include <time.h>
#include "knot/common/fdset.h"
......@@ -66,10 +67,8 @@ void* thr_action(void *arg)
int *fd = (int *)arg;
/* Sleep for 100ms. */
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 100 * 1000; // 100ms
select(0, 0, 0, 0, &tv);
struct timespec ts = { .tv_nsec = 1e8 };
clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL);
/* Write pattern. */
char pattern = WRITE_PATTERN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment