commit c42c3780274e6b12eaeab918cf7c13d2c36cf253 from: Quentin Rameau via: Hiltjo Posthuma date: Sun Sep 27 22:15:13 2015 UTC Replace deprecated usleep() with nanosleep() commit - c15a95a061bdb8235220b37638d1b586611f0ac6 commit + c42c3780274e6b12eaeab918cf7c13d2c36cf253 blob - 49a65835ed5bd86079e2374e08f4d9b0700f6f20 blob + aa6e5d8ef1cca02c25f6c1468f3fac4b463176f3 --- dmenu.c +++ dmenu.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -203,6 +203,7 @@ drawmenu(void) static void grabkeyboard(void) { + struct timespec ts = { .tv_sec = 1, .tv_nsec = 0 }; int i; /* try to grab keyboard, we may have to wait for another process to ungrab */ @@ -210,7 +211,7 @@ grabkeyboard(void) if (XGrabKeyboard(dpy, DefaultRootWindow(dpy), True, GrabModeAsync, GrabModeAsync, CurrentTime) == GrabSuccess) return; - usleep(1000); + nanosleep(&ts, NULL); } die("cannot grab keyboard\n"); }