mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org>
PR 1531/newlib: * libmisc/shell/fts.c: Add local copy of ALIGN().
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user