]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: make usleep() workaround work
authorWerner Fink <werner@suse.de>
Fri, 7 Dec 2012 08:00:55 +0000 (09:00 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Dec 2012 14:07:58 +0000 (15:07 +0100)
Simply fix a compile problem found during debugging console.c

Signed-off-by: Werner Fink <werner@suse.de>
include/c.h

index 110728797f552073b24d8b227b61d05460513842..ec1020ee0fe3631a1da2b374fdaae00f456fd5b9 100644 (file)
 # include <err.h>
 #endif
 
+#ifndef HAVE_USLEEP
+# include <time.h>
+#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