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.
This commit is contained in:
Saúl Ibarra Corretgé 2014-03-10 09:06:01 +01:00
parent 1ec4c23438
commit daa457b1c0

View File

@ -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;
}