diff --git a/nbase/nbase.h b/nbase/nbase.h index dd45856a6..c6cf17e74 100644 --- a/nbase/nbase.h +++ b/nbase/nbase.h @@ -378,7 +378,7 @@ char *socket_strerror(int errnum); /* The usleep() function is important as well */ #ifndef HAVE_USLEEP #if defined( HAVE_NANOSLEEP) || defined(WIN32) -void usleep(unsigned long usec); +int usleep(unsigned long usec); #endif #endif diff --git a/nbase/nbase_time.c b/nbase/nbase_time.c index 16e2d835a..93b321047 100644 --- a/nbase/nbase_time.c +++ b/nbase/nbase_time.c @@ -72,14 +72,15 @@ #endif #ifndef HAVE_USLEEP -void usleep(unsigned long usec) { +int usleep(unsigned long usec) { #ifdef HAVE_NANOSLEEP struct timespec ts; ts.tv_sec = usec / 1000000; ts.tv_nsec = (usec % 1000000) * 1000; -nanosleep(&ts, NULL); +return nanosleep(&ts, NULL); #else /* Windows style */ Sleep( usec / 1000 ); + return 0; #endif /* HAVE_NANOSLEEP */ } #endif