Simply fix a compile problem found during debugging console.c
Signed-off-by: Werner Fink <werner@suse.de>
# include <err.h>
#endif
+#ifndef HAVE_USLEEP
+# include <time.h>
+#endif
+
/*
* Compiler specific stuff
*/
* This function is marked obsolete in POSIX.1-2001 and removed in
* POSIX.1-2008. It is replaced with nanosleep().
*/
-static inline usleep(useconds_t usec)
+static inline int usleep(useconds_t usec)
{
struct timespec waittime = {
.tv_sec = usec / 1000000L,
.tv_nsec = (usec % 1000000L) * 1000
- }
- nanosleep(&waittime, NULL);
+ };
+ return nanosleep(&waittime, NULL);
}
#endif