diff options
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r-- | openbsd-compat/bsd-misc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 17d731bd2..55f100ac0 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include "includes.h" | 18 | #include "includes.h" |
19 | 19 | ||
20 | #include <sys/types.h> | ||
20 | #ifdef HAVE_SYS_SELECT_H | 21 | #ifdef HAVE_SYS_SELECT_H |
21 | # include <sys/select.h> | 22 | # include <sys/select.h> |
22 | #endif | 23 | #endif |
@@ -27,6 +28,7 @@ | |||
27 | #include <string.h> | 28 | #include <string.h> |
28 | #include <signal.h> | 29 | #include <signal.h> |
29 | #include <stdlib.h> | 30 | #include <stdlib.h> |
31 | #include <unistd.h> | ||
30 | 32 | ||
31 | #include "xmalloc.h" | 33 | #include "xmalloc.h" |
32 | 34 | ||
@@ -156,7 +158,8 @@ int nanosleep(const struct timespec *req, struct timespec *rem) | |||
156 | tremain.tv_sec = 0; | 158 | tremain.tv_sec = 0; |
157 | tremain.tv_usec = 0; | 159 | tremain.tv_usec = 0; |
158 | } | 160 | } |
159 | TIMEVAL_TO_TIMESPEC(&tremain, rem) | 161 | if (rem != NULL) |
162 | TIMEVAL_TO_TIMESPEC(&tremain, rem) | ||
160 | 163 | ||
161 | return(rc); | 164 | return(rc); |
162 | } | 165 | } |