summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-08-02 22:51:56 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-08-02 22:51:56 +0000
commitcd24faad5fbb8ab6a14b04a38ebb3c35802b7c18 (patch)
treeb8d072e5da05097b2cd50dddc8380a7bd0967587
parent24cdab4d1ad5e3528b82f221a7d87ac09baf560b (diff)
downloadcoreutils-cd24faad5fbb8ab6a14b04a38ebb3c35802b7c18.tar.xz
nanosleep.c (errno): Remove decl; we now assume C89 or better.
Include stdbool.h. (rpl_nanosleep): Usee bool for booleans.
-rw-r--r--lib/nanosleep.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/nanosleep.c b/lib/nanosleep.c
index c5451ffc4..2f91c31d8 100644
--- a/lib/nanosleep.c
+++ b/lib/nanosleep.c
@@ -23,14 +23,12 @@
prototype for rpl_nanosleep. (they'd conflict e.g., on alpha-dec-osf3.2) */
#undef nanosleep
+#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#if HAVE_UNISTD_H
# include <unistd.h>
@@ -77,7 +75,7 @@ int
rpl_nanosleep (const struct timespec *requested_delay,
struct timespec *remaining_delay)
{
- static int initialized;
+ static bool initialized;
#ifdef SA_NOCLDSTOP
struct sigaction oldact, newact;
@@ -100,7 +98,7 @@ rpl_nanosleep (const struct timespec *requested_delay,
if (signal (SIGCONT, SIG_IGN) != SIG_IGN)
signal (SIGCONT, sighandler);
#endif
- initialized = 1;
+ initialized = true;
}
my_usleep (requested_delay);