#include <syslog.h>
#include <getopt.h>
#include <signal.h>
+#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
while (1) {
struct stat statbuf;
+ const struct timespec duration = { 0 , 1000 * 1000 * 1000 / LOOP_PER_SECOND };
if (exists != NULL && stat(exists, &statbuf) == 0) {
rc = 0;
if (is_timeout)
break;
- usleep(1000 * 1000 / LOOP_PER_SECOND);
+ nanosleep(&duration, NULL);
}
/* if we reached the timeout, print the list of remaining events */