Coding style cleanup in dock.c
[wmaker-crm.git] / WINGs / usleep.c
blobfcdf32777c95aa8f709c86c55f269b4715a886f5
2 #include <errno.h>
3 #include <time.h>
5 #include "wconfig.h"
7 void wusleep(unsigned int usec)
9 struct timespec tm;
11 /* An arbitrary limit of 10 minutes -- in WM, if
12 * somethings wants to sleep anything even close to
13 * this, it's most likely an error.
15 if (usec > 600000000)
16 return;
18 tm.tv_sec = usec / 1000000;
19 tm.tv_nsec = (usec % 1000000) * 1000;
21 while (nanosleep(&tm, &tm) == -1 && errno == EINTR)