From d71fcabaa6bc42e82d83060da49abff2b41ee272 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 12 Oct 1999 18:44:40 +0000 Subject: Added call to freenod to let each filesystem free its own internal node used to manage file access. --- cpukit/libcsupport/src/chmod.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cpukit/libcsupport/src/chmod.c') diff --git a/cpukit/libcsupport/src/chmod.c b/cpukit/libcsupport/src/chmod.c index fa57d50691..acfc142ad0 100644 --- a/cpukit/libcsupport/src/chmod.c +++ b/cpukit/libcsupport/src/chmod.c @@ -28,13 +28,22 @@ int chmod( { int status; rtems_filesystem_location_info_t loc; + int result; status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE ); if ( status != 0 ) return -1; - if ( !loc.handlers->fchmod ) + if ( !loc.handlers->fchmod ){ + if ( loc.ops->freenod ) + (*loc.ops->freenod)( &loc ); set_errno_and_return_minus_one( ENOTSUP ); + } - return (*loc.handlers->fchmod)( &loc, mode ); + result = (*loc.handlers->fchmod)( &loc, mode ); + + if ( loc.ops->freenod ) + (*loc.ops->freenod)( &loc ); + + return result; } -- cgit v1.2.3