summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWerner Fink2012-12-07 09:00:55 +0100
committerKarel Zak2012-12-18 15:07:58 +0100
commitb33f24b250878db0e09f81de2d2dc090bdeb441a (patch)
tree0220373e34047af7bcc5f27409277fa2023871d5 /include
parentsulogin: use the linked lists from list.h for consoles list (diff)
downloadkernel-qcow2-util-linux-b33f24b250878db0e09f81de2d2dc090bdeb441a.tar.gz
kernel-qcow2-util-linux-b33f24b250878db0e09f81de2d2dc090bdeb441a.tar.xz
kernel-qcow2-util-linux-b33f24b250878db0e09f81de2d2dc090bdeb441a.zip
sulogin: make usleep() workaround work
Simply fix a compile problem found during debugging console.c Signed-off-by: Werner Fink <werner@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/c.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/c.h b/include/c.h
index 110728797..ec1020ee0 100644
--- a/include/c.h
+++ b/include/c.h
@@ -19,6 +19,10 @@
# 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