From: Darren Tucker Date: Thu, 8 May 2025 08:56:39 +0000 (+1000) Subject: Since it's unused, make dirfd() take void *. X-Git-Tag: V_10_1_P1~304 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5726215957bb34e18bb872d527845c2f64e2389;p=thirdparty%2Fopenssh-portable.git Since it's unused, make dirfd() take void *. Some platforms (eg Old BSDs) in some configurations define DIR to "void *", which causes compile errors in the no-op implementation. --- diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 09bbb6049..669d2bb7e 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -160,7 +160,7 @@ utimensat(int fd, const char *path, const struct timespec times[2], #ifndef HAVE_DIRFD int -dirfd(DIR *dir) +dirfd(void *dir) { errno = ENOSYS; return -1; diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 4ac73c73e..d237256d4 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h @@ -66,9 +66,7 @@ int utimes(const char *, struct timeval *); #endif /* HAVE_UTIMES */ #ifndef HAVE_DIRFD -#include -#include -int dirfd(DIR *); +int dirfd(void *); #endif #ifndef AT_FDCWD