>From 9fcdca78649a1b7a6f19db4729e621388ad89814 Mon Sep 17 00:00:00 2001 From: sin <s...@2f30.org> Date: Mon, 3 Mar 2014 13:57:30 +0000 Subject: [PATCH] Fix building on OpenBSD 5.5
getdirentries() has been removed and instead we should use getdents(). --- lib9/dirread.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib9/dirread.c b/lib9/dirread.c index 99d5597..f114195 100644 --- a/lib9/dirread.c +++ b/lib9/dirread.c @@ -28,12 +28,21 @@ mygetdents(int fd, struct dirent *buf, int n) return getdirentries(fd, (void*)buf, n, &off); } #elif defined(__OpenBSD__) +#include <sys/param.h> +# if OpenBSD < 201405 /* for OpenBSD 5.4 and earlier */ static int mygetdents(int fd, struct dirent *buf, int n) { off_t off; return getdirentries(fd, (void*)buf, n, &off); } +# else +static int +mygetdents(int fd, struct dirent *buf, int n) +{ + return getdents(fd, (void*)buf, n); +} +# endif #elif defined(__sun__) || defined(__NetBSD__) static int mygetdents(int fd, struct dirent *buf, int n) -- 1.8.5.3