struct timespec's tm_nsec is in nanoseconds, not microseconds.

Signed-off-by: Brad Jorsch <[email protected]>
---
 WINGs/usleep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/WINGs/usleep.c b/WINGs/usleep.c
index acf0583..fcdf327 100644
--- a/WINGs/usleep.c
+++ b/WINGs/usleep.c
@@ -16,7 +16,7 @@ void wusleep(unsigned int usec)
                return;
 
        tm.tv_sec = usec / 1000000;
-       tm.tv_nsec = usec % 1000000;
+       tm.tv_nsec = (usec % 1000000) * 1000;
 
        while (nanosleep(&tm, &tm) == -1 && errno == EINTR)
                ;
-- 
1.7.1


-- 
To unsubscribe, send mail to [email protected].

Reply via email to