public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Werner Fink <werner@suse.de>
To: util-linux@vger.kernel.org
Cc: Karel Zak <kzak@redhat.com>, Werner Fink <werner@suse.de>
Subject: [PATCH 2/5] sulogin: make usleep() workaround work
Date: Fri,  7 Dec 2012 09:00:55 +0100	[thread overview]
Message-ID: <1354867258-14206-2-git-send-email-werner@suse.de> (raw)
In-Reply-To: <1354867258-14206-1-git-send-email-werner@suse.de>

Simply fix a compile problem found during debugging console.c

Signed-off-by: Werner Fink <werner@suse.de>
---
 include/c.h |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git include/c.h include/c.h
index 1107287..ec1020e 100644
--- include/c.h
+++ 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
 
-- 
1.7.10.4


  reply	other threads:[~2012-12-07  8:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  8:00 [PATCH 1/5] sulogin: use the linked lists from list.h for consoles list Werner Fink
2012-12-07  8:00 ` Werner Fink [this message]
2012-12-18 15:07   ` [PATCH 2/5] sulogin: make usleep() workaround work Karel Zak
2012-12-07  8:00 ` [PATCH 3/5] sulogin: use alarm function to indicate if a timeout occurs Werner Fink
2012-12-18 15:15   ` Karel Zak
2012-12-07  8:00 ` [PATCH 4/5] sulogin: mount temporary /dev and /proc if not found Werner Fink
2012-12-07 14:17   ` Dave Reisner
2012-12-07 15:49     ` [util-linux] " Dr. Werner Fink
2012-12-07 17:01       ` Dave Reisner
2012-12-07 17:25         ` Dr. Werner Fink
2012-12-10 12:27         ` Werner Fink
2012-12-18 15:23           ` Karel Zak
2012-12-23  4:33             ` Dave Reisner
2012-12-23 21:53               ` Karel Zak
2012-12-10 12:27         ` [PATCH 5/5] sulogin: add multi console feature from SysVinit sulogin Werner Fink
2012-12-18 15:18           ` Karel Zak
2012-12-18 15:17   ` [PATCH 4/5] sulogin: mount temporary /dev and /proc if not found Karel Zak
2012-12-07  8:00 ` [PATCH 5/5] sulogin: add multi console feature from SysVinit sulogin Werner Fink
2012-12-07 10:27   ` Dr. Werner Fink
2012-12-18 15:05 ` [PATCH 1/5] sulogin: use the linked lists from list.h for consoles list Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354867258-14206-2-git-send-email-werner@suse.de \
    --to=werner@suse.de \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox