Skip to content

Commit f572621

Browse files
committed
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.
1 parent 1511f11 commit f572621

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

openbsd-compat/bsd-misc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ utimensat(int fd, const char *path, const struct timespec times[2],
160160

161161
#ifndef HAVE_DIRFD
162162
int
163-
dirfd(DIR *dir)
163+
dirfd(void *dir)
164164
{
165165
errno = ENOSYS;
166166
return -1;

openbsd-compat/bsd-misc.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ int utimes(const char *, struct timeval *);
6666
#endif /* HAVE_UTIMES */
6767

6868
#ifndef HAVE_DIRFD
69-
#include <sys/types.h>
70-
#include <dirent.h>
71-
int dirfd(DIR *);
69+
int dirfd(void *);
7270
#endif
7371

7472
#ifndef AT_FDCWD

0 commit comments

Comments
 (0)