summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2010-05-29 05:17:11 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2010-05-29 05:17:11 +0000
commit1f868bd64e87d7a203fd357c686f4d25a6d3c283 (patch)
treef0347d1f6a2483ebbf2f3a4235f0a202dc04ab21 /cpukit
parent2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-1f868bd64e87d7a203fd357c686f4d25a6d3c283.tar.bz2
2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org>
PR 1531/newlib: * libmisc/shell/fts.c: Add local copy of ALIGN().
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/libmisc/shell/fts.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 807737aabf..4b31b254e9 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,11 @@
2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org>
+ PR 1531/newlib:
+ * libmisc/shell/fts.c:
+ Add local copy of ALIGN().
+
+2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org>
+
* libnetworking/net/if.c:
Use uintptr_t and void* in _offsetof().
* libnetworking/netinet/raw_ip.c:
diff --git a/cpukit/libmisc/shell/fts.c b/cpukit/libmisc/shell/fts.c
index 63d4eef393..2fd91b874c 100644
--- a/cpukit/libmisc/shell/fts.c
+++ b/cpukit/libmisc/shell/fts.c
@@ -87,6 +87,10 @@ static int fts_safe_changedir(const FTS *, const FTSENT *, int,
#if defined(ALIGNBYTES) && defined(ALIGN)
#define FTS_ALLOC_ALIGNED 1
+/* FIXME: Redefine because some versions of
+ * RTEMS newlib and the BSDs ship a broken ALIGN */
+#undef ALIGN
+#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES)
#else
#undef FTS_ALLOC_ALIGNED
#endif
@@ -1055,8 +1059,7 @@ fts_alloc(FTS *sp, const char *name, size_t namelen)
return (NULL);
if (!ISSET(FTS_NOSTAT))
- p->fts_statp = (__fts_stat_t *)ALIGN(
- (uintptr_t)(p->fts_name + namelen + 2));
+ p->fts_statp = (__fts_stat_t *)ALIGN(p->fts_name + namelen + 2);
#else
if ((p = malloc(sizeof(FTSENT) + namelen)) == NULL)
return (NULL);