From daa457b1c043b46fb0936bb08787752f1daa445e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 10 Mar 2014 09:06:01 +0100 Subject: [PATCH] openbsd, osx: fix compilation warning on scandir The select function takes a const struct on newer OSX versions but it doesn't on OSX <= 10.7 or OpenBSD. --- src/unix/fs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/fs.c b/src/unix/fs.c index b06f992d..cf45669c 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -271,7 +271,11 @@ static ssize_t uv__fs_read(uv_fs_t* req) { } +#if defined(__OpenBSD__) || (defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_8)) +static int uv__fs_readdir_filter(struct dirent* dent) { +#else static int uv__fs_readdir_filter(const struct dirent* dent) { +#endif return strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0; }