if pathconf fails (like on obsd and nfs) fall back to NAME_MAX or 256

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@600 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.2
Jan Kneschke 18 years ago
parent dae1a08d55
commit 86ac3fb37f

@ -417,7 +417,13 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
i = dir->used - 1;
#ifdef HAVE_PATHCONF
name_max = pathconf(dir->ptr, _PC_NAME_MAX);
if (-1 == (name_max = pathconf(dir->ptr, _PC_NAME_MAX))) {
#ifdef NAME_MAX
name_max = NAME_MAX;
#else
name_max = 256; /* stupid default */
#endif
}
#elif defined __WIN32
name_max = FILENAME_MAX;
#else

Loading…
Cancel
Save