summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/nanosleep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/nanosleep.c b/lib/nanosleep.c
index d5789bd46..126a02622 100644
--- a/lib/nanosleep.c
+++ b/lib/nanosleep.c
@@ -22,6 +22,11 @@
#include <sys/types.h>
#include <signal.h>
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -98,5 +103,7 @@ nanosleep (const struct timespec *requested_delay,
/* FIXME: Restore sig handler? */
+ errno = EINTR;
+
return suspended;
}