Skip to content
Snippets Groups Projects
Commit 83d32a1f authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Somewhat more portable.

Rev: src/modules/files/efuns.c:1.16
parent dff7f771
Branches
Tags
No related merge requests found
......@@ -190,10 +190,13 @@ void f_get_dir(INT32 args)
int lens[FPR];
struct dirent *tmp;
if (!(tmp = alloca(sizeof(struct dirent) +
pathconf(path, _PC_NAME_MAX) + 1))) {
error("get_dir(): Out of memory!\n");
}
tmp = xalloc(sizeof(struct dirent) +
#ifdef HAVE_SOLARIS_READDIR_R
pathconf(path, _PC_NAME_MAX)
#else
NAME_MAX
#endif /* HAVE_SOLARIS_READDIR_R */
+ 1);
while(1)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment