From b33f24b250878db0e09f81de2d2dc090bdeb441a Mon Sep 17 00:00:00 2001 From: Werner Fink Date: Fri, 7 Dec 2012 09:00:55 +0100 Subject: [PATCH] sulogin: make usleep() workaround work Simply fix a compile problem found during debugging console.c Signed-off-by: Werner Fink --- include/c.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/c.h b/include/c.h index 110728797f..ec1020ee0f 100644 --- a/include/c.h +++ b/include/c.h @@ -19,6 +19,10 @@ # include #endif +#ifndef HAVE_USLEEP +# include +#endif + /* * Compiler specific stuff */ @@ -246,13 +250,13 @@ static inline size_t get_hostname_max(void) * 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 -- 2.47.3