#include <syslog.h>
#include <getopt.h>
#include <signal.h>
+#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
if (start > end) {
err(udev, "seq-start larger than seq-end, ignoring\n");
- fprintf(stderr, "seq-start larger than seq-end, ignoring\n");
start = 0;
end = 0;
}
if (start > kernel_seq || end > kernel_seq) {
err(udev, "seq-start or seq-end larger than current kernel value, ignoring\n");
- fprintf(stderr, "seq-start or seq-end larger than current kernel value, ignoring\n");
start = 0;
end = 0;
}
} else {
if (end > 0) {
err(udev, "seq-end needs seq-start parameter, ignoring\n");
- fprintf(stderr, "seq-end needs seq-start parameter, ignoring\n");
end = 0;
}
}
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 */