Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | Add missing defines for uclibc |
| 2 | |
| 3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 4 | Upstream-Status: Inappropriate |
| 5 | |
| 6 | --- fts.orig/fts.c |
| 7 | +++ fts/fts.c |
| 8 | @@ -31,6 +31,10 @@ |
| 9 | * SUCH DAMAGE. |
| 10 | */ |
| 11 | |
| 12 | +#define alignof(TYPE) ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) |
| 13 | +#define ALIGNBYTES (alignof(long double) - 1) |
| 14 | +#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES) |
| 15 | + |
| 16 | #if defined(LIBC_SCCS) && !defined(lint) |
| 17 | static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; |
| 18 | #endif /* LIBC_SCCS and not lint */ |
| 19 | @@ -652,10 +656,10 @@ |
| 20 | if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) |
| 21 | continue; |
| 22 | |
| 23 | - if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_namlen)) == NULL) |
| 24 | + if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_reclen)) == NULL) |
| 25 | goto mem1; |
| 26 | - if (dp->d_namlen > maxlen) { |
| 27 | - if (fts_palloc(sp, (size_t)dp->d_namlen)) { |
| 28 | + if (dp->d_reclen > maxlen) { |
| 29 | + if (fts_palloc(sp, (size_t)dp->d_reclen)) { |
| 30 | /* |
| 31 | * No more memory for path or structures. Save |
| 32 | * errno, free up the current structure and the |
| 33 | @@ -675,7 +679,7 @@ |
| 34 | maxlen = sp->fts_pathlen - sp->fts_cur->fts_pathlen - 1; |
| 35 | } |
| 36 | |
| 37 | - p->fts_pathlen = len + dp->d_namlen + 1; |
| 38 | + p->fts_pathlen = len + dp->d_reclen + 1; |
| 39 | p->fts_parent = sp->fts_cur; |
| 40 | p->fts_level = level; |
| 41 | |
| 42 | @@ -784,7 +788,7 @@ |
| 43 | /* If user needs stat info, stat buffer already allocated. */ |
| 44 | sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp; |
| 45 | |
| 46 | -#ifdef DT_WHT |
| 47 | +#ifdef S_IFWHT |
| 48 | /* |
| 49 | * Whited-out files don't really exist. However, there's stat(2) file |
| 50 | * mask for them, so we set it so that programs (i.e., find) don't have |