From e525f66b09e11427852da956424c71d784d828c6 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Tue, 22 Jun 2010 20:03:41 +0000 Subject: [PATCH] 2010-06-22 Jennifer Averett * libcsupport/Makefile.am, libcsupport/include/rtems/libio_.h: Moved method to free a node from a define to an external method. * libcsupport/src/freenode.c: New file. --- cpukit/ChangeLog | 6 ++++++ cpukit/libcsupport/Makefile.am | 3 ++- cpukit/libcsupport/include/rtems/libio_.h | 8 +------- cpukit/libcsupport/src/freenode.c | 22 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 cpukit/libcsupport/src/freenode.c diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 822fb50383..5aa4bc8c7a 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2010-06-22 Jennifer Averett + + * libcsupport/Makefile.am, libcsupport/include/rtems/libio_.h: Moved + method to free a node from a define to an external method. + * libcsupport/src/freenode.c: New file. + 2010-06-22 Jennifer Averett * posix/src/nanosleep.c, posix/src/timersettime.c: Removed redundent diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am index 368833b60b..d2e60c7c2f 100644 --- a/cpukit/libcsupport/Makefile.am +++ b/cpukit/libcsupport/Makefile.am @@ -84,7 +84,8 @@ ID_C_FILES = src/getegid.c src/geteuid.c src/getgid.c src/getgroups.c \ src/setpgid.c src/setsid.c MALLOC_C_FILES = src/malloc_initialize.c src/calloc.c src/malloc.c \ - src/realloc.c src/_calloc_r.c src/free.c src/_free_r.c src/_malloc_r.c \ + src/realloc.c src/_calloc_r.c src/_malloc_r.c \ + src/free.c src/freenode.c src/_free_r.c \ src/_realloc_r.c src/__brk.c src/__sbrk.c src/mallocfreespace.c \ src/mallocinfo.c src/malloc_walk.c src/malloc_get_statistics.c \ src/malloc_report_statistics.c src/malloc_report_statistics_plugin.c \ diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index a6c7860672..6abc1ee5e0 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -148,13 +148,7 @@ extern rtems_libio_t *rtems_libio_iop_freelist; * Macro to free a node. */ -#define rtems_filesystem_freenode( _node ) \ - do { \ - if ( (_node)->ops )\ - if ( (_node)->ops->freenod_h ) \ - (*(_node)->ops->freenod_h)( (_node) ); \ - } while (0) - +void rtems_filesystem_freenode( rtems_filesystem_location_info_t* node ); /* * External structures diff --git a/cpukit/libcsupport/src/freenode.c b/cpukit/libcsupport/src/freenode.c new file mode 100644 index 0000000000..c99db96271 --- /dev/null +++ b/cpukit/libcsupport/src/freenode.c @@ -0,0 +1,22 @@ +/* + * freenode() + * + * COPYRIGHT (c) 1989-2010. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include +#include + +void rtems_filesystem_freenode( rtems_filesystem_location_info_t *_node ) +{ + if ( _node->ops ) + if ( _node->ops->freenod_h ) + _node->ops->freenod_h(_node ); +}