1 --- scandir.c.orig 2009-11-07 14:51:38.000000000 -0800
2 +++ scandir.c 2009-11-07 14:51:40.000000000 -0800
3 @@ -47,15 +47,11 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/sca
4 #include "un-namespace.h"
7 - * The DIRSIZ macro is the minimum record length which will hold the directory
8 + * The _GENERIC_DIRSIZ macro is the minimum record length which will hold the directory
9 * entry. This requires the amount of space in struct dirent without the
10 * d_name field, plus enough space for the name and a terminating nul byte
11 * (dp->d_namlen + 1), rounded up to a 4 byte boundary.
15 - ((sizeof(struct dirent) - sizeof(dp)->d_name) + \
16 - (((dp)->d_namlen + 1 + 3) &~ 3))
19 scandir(dirname, namelist, select, dcomp)
20 @@ -83,7 +79,7 @@ scandir(dirname, namelist, select, dcomp
22 * Make a minimum size copy of the data
24 - p = (struct dirent *)malloc(DIRSIZ(d));
25 + p = (struct dirent *)malloc(_GENERIC_DIRSIZ(d));
28 p->d_fileno = d->d_fileno;