From: Werner Fink Date: Fri, 7 Dec 2012 08:00:55 +0000 (+0100) Subject: sulogin: make usleep() workaround work X-Git-Tag: v2.23-rc1~419 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b33f24b250878db0e09f81de2d2dc090bdeb441a;p=thirdparty%2Futil-linux.git sulogin: make usleep() workaround work Simply fix a compile problem found during debugging console.c Signed-off-by: Werner Fink --- 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