summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs/imfs_unlink.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-05 21:10:54 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-05 21:10:54 +0000
commit94b357c2b31be20b51784dc6f2ae837d58777cbd (patch)
tree73e3ec3694451a65df6b0688e3e0e04175ea0528 /cpukit/libfs/src/imfs/imfs_unlink.c
parent6c85bdda73e6e9676a1f7b329d826a02640dfeb8 (diff)
downloadrtems-94b357c2b31be20b51784dc6f2ae837d58777cbd.tar.bz2
Unmount was failing as a side-effect of splitting the rmnod handler
and not handling every case properly.
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_unlink.c')
-rw-r--r--cpukit/libfs/src/imfs/imfs_unlink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_unlink.c b/cpukit/libfs/src/imfs/imfs_unlink.c
index e138064e61..03938937f4 100644
--- a/cpukit/libfs/src/imfs/imfs_unlink.c
+++ b/cpukit/libfs/src/imfs/imfs_unlink.c
@@ -49,9 +49,10 @@ int IMFS_unlink(
the_link.node_access = node->info.hard_link.link_node;
/*
- * If this is the last referance to the node
- * Free the node that the link points to.
+ * If removing the last hard link to a node, then we need
+ * to remove the node that is a link and the node itself.
*/
+
node->info.hard_link.link_node->st_nlink --;
IMFS_update_ctime( node->info.hard_link.link_node );
if ( node->info.hard_link.link_node->st_nlink < 1) {
@@ -61,7 +62,11 @@ int IMFS_unlink(
}
}
- result = (*loc->handlers->rmnod)( &the_link );
+ /*
+ * Now actually free the node we were asked to free.
+ */
+
+ result = (*loc->handlers->rmnod)( loc );
return result;
}