summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs/imfs_link.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-01-19 19:31:00 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-01-19 19:31:00 +0000
commitcb4e99201e1702a62af73debe342ea289f0d8362 (patch)
tree59ce92a3f4280b556c1456896b77a3ea3e57dbab /cpukit/libfs/src/imfs/imfs_link.c
parentUpdate of libblock API, update of tqm8xx BSP (diff)
downloadrtems-cb4e99201e1702a62af73debe342ea289f0d8362.tar.bz2
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_creat.c, libfs/src/imfs/imfs_initsupp.c, libfs/src/imfs/imfs_link.c, libfs/src/imfs/imfs_load_tar.c, libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_symlink.c: Create special helper method for creating the j-node for the root directory. This lets us assume that every j-node created otherwise has a parent node.
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_link.c')
-rw-r--r--cpukit/libfs/src/imfs/imfs_link.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_link.c b/cpukit/libfs/src/imfs/imfs_link.c
index b9bab7a520..4c2136ba71 100644
--- a/cpukit/libfs/src/imfs/imfs_link.c
+++ b/cpukit/libfs/src/imfs/imfs_link.c
@@ -38,7 +38,6 @@ int IMFS_link(
/*
* Verify this node can be linked to.
*/
-
info.hard_link.link_node = to_loc->node_access;
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
rtems_set_errno_and_return_minus_one( EMLINK );
@@ -46,17 +45,18 @@ int IMFS_link(
/*
* Remove any separators at the end of the string.
*/
-
IMFS_get_token( token, strlen( token ), new_name, &i );
/*
* Create a new link node.
*
- * NOTE: Coverity thinks this is a resource leak since a node
- * is created but never deleted. The scope of the allocation
- * is that of a file -- not this method. Coverity Id 19.
+ * NOTE: Coverity Id 19 reports this as a leak
+ * While technically not a leak, it indicated that IMFS_create_node
+ * was ONLY passed a NULL when we created the root node. We
+ * added a new IMFS_create_root_node() so this path no longer
+ * existed. The result was simpler code which should not have
+ * this path.
*/
-
new_node = IMFS_create_node(
parent_loc,
IMFS_HARD_LINK,
@@ -71,7 +71,6 @@ int IMFS_link(
/*
* Increment the link count of the node being pointed to.
*/
-
info.hard_link.link_node->st_nlink++;
IMFS_update_ctime( info.hard_link.link_node );