From efb5450a87d50c53584d361c92d5928098233f58 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 17 Oct 2001 17:57:42 +0000 Subject: 2001-10-17 Till Straumann * These changes were discussed and reviewed by many people but the primary people were Jennifer Averett and Eugeny Mints . * libc/utime.c: Add missing call to rtems_filesystem_freenode() at verification that utime is supported by the filesystem. * libc/link.c: Remove calls to freenode when the node was not successfully allocated. * libc/unmount.c: In the method file_systems_below_this_mountpoint() added calls to correctly free fs_root_loc when a failure occurs. * libc/open.c: Add freenode calls upon failure. * libc/open.c, lib/libc/close.c: (PENDING -- NOT INCLUDED THIS TIMER) Modifications the move the freenode from open() to close() (also part of this patch) are pending further discussion. --- cpukit/libcsupport/src/unmount.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpukit/libcsupport/src/unmount.c') diff --git a/cpukit/libcsupport/src/unmount.c b/cpukit/libcsupport/src/unmount.c index dfd1797112..81e097c818 100644 --- a/cpukit/libcsupport/src/unmount.c +++ b/cpukit/libcsupport/src/unmount.c @@ -168,8 +168,10 @@ int file_systems_below_this_mountpoint( */ *fs_to_unmount = *fs_root_loc->mt_entry; - if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access ) + if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access ){ + rtems_filesystem_freenode(fs_root_loc); set_errno_and_return_minus_one( EACCES ); + } /* * Search the mount table for any mount entries referencing this @@ -181,7 +183,8 @@ int file_systems_below_this_mountpoint( the_node = the_node->next ) { the_mount_entry = ( rtems_filesystem_mount_table_entry_t * )the_node; if (the_mount_entry->mt_point_node.mt_entry == fs_root_loc->mt_entry ) { - set_errno_and_return_minus_one( EBUSY ); + rtems_filesystem_freenode(fs_root_loc); + set_errno_and_return_minus_one( EBUSY ); } } -- cgit v1.2.3