[openssh-commits] [openssh] branch master updated: Since it's unused, make dirfd() take void *.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu May 8 18:58:51 AEST 2025


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

The following commit(s) were added to refs/heads/master by this push:
     new f57262159 Since it's unused, make dirfd() take void *.
f57262159 is described below

commit f5726215957bb34e18bb872d527845c2f64e2389
Author: Darren Tucker <dtucker at dtucker.net>
AuthorDate: Thu May 8 18:56:39 2025 +1000

    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.
---
 openbsd-compat/bsd-misc.c | 2 +-
 openbsd-compat/bsd-misc.h | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

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 <sys/types.h>
-#include <dirent.h>
-int dirfd(DIR *);
+int dirfd(void *);
 #endif
 
 #ifndef AT_FDCWD

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list