From 2d3760a17c58812cf1058acad01b1f826005cc5e Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 2 Oct 2012 14:37:13 +0200 Subject: [PATCH] unix: fix scandir filter prototype The dirent argument is const on systems that conform to POSIX.2008 (Linux and Solaris) but non-const on others. --- src/unix/fs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/fs.c b/src/unix/fs.c index 8769f18d..37da7b63 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -154,7 +154,11 @@ static ssize_t uv__fs_read(uv_fs_t* req) { } +#if defined(__linux__) || defined(__sun) static int uv__fs_readdir_filter(const struct dirent* dent) { +#else +static int uv__fs_readdir_filter(struct dirent* dent) { +#endif return strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0; }