summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/chown.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-12 18:44:40 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-12 18:44:40 +0000
commitd71fcabaa6bc42e82d83060da49abff2b41ee272 (patch)
tree0fe667b13aa15cbab7baaed510a894fa1cb9dd78 /cpukit/libcsupport/src/chown.c
parentChanged bcopy to strncpy to stick to ANSI/ISO routines. (diff)
downloadrtems-d71fcabaa6bc42e82d83060da49abff2b41ee272.tar.bz2
Added call to freenod to let each filesystem free its own internal
node used to manage file access.
Diffstat (limited to 'cpukit/libcsupport/src/chown.c')
-rw-r--r--cpukit/libcsupport/src/chown.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/cpukit/libcsupport/src/chown.c b/cpukit/libcsupport/src/chown.c
index 189096dcd1..cc579b40a5 100644
--- a/cpukit/libcsupport/src/chown.c
+++ b/cpukit/libcsupport/src/chown.c
@@ -26,13 +26,22 @@ int chown(
gid_t group
)
{
- rtems_filesystem_location_info_t temp_loc;
+ rtems_filesystem_location_info_t loc;
+ int result;
- if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) )
+ if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) )
return -1;
- if ( !temp_loc.ops->chown )
+ if ( !loc.ops->chown ) {
+ if ( loc.ops->freenod )
+ (*loc.ops->freenod)( &loc );
set_errno_and_return_minus_one( ENOTSUP );
+ }
- return (*temp_loc.ops->chown)( &temp_loc, owner, group );
+ result = (*loc.ops->chown)( &loc, owner, group );
+
+ if ( loc.ops->freenod )
+ (*loc.ops->freenod)( &loc );
+
+ return result;
}