X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/bd2a08011025baef5a239e0e17cc6d94db592d94..9b4b86c2134a67e76ed043f67481cd5da84511a8:/openbsd-compat/bsd-misc.c diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index b9215245..55f100ac 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -16,9 +16,21 @@ */ #include "includes.h" -#include "xmalloc.h" -RCSID("$Id$"); +#include +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_TIME_H +# include +#endif + +#include +#include +#include +#include + +#include "xmalloc.h" #ifndef HAVE___PROGNAME char *__progname; @@ -146,7 +158,8 @@ int nanosleep(const struct timespec *req, struct timespec *rem) tremain.tv_sec = 0; tremain.tv_usec = 0; } - TIMEVAL_TO_TIMESPEC(&tremain, rem) + if (rem != NULL) + TIMEVAL_TO_TIMESPEC(&tremain, rem) return(rc); }