summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs/imfs_symlink.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_symlink.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_symlink.c')
-rw-r--r--cpukit/libfs/src/imfs/imfs_symlink.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_symlink.c b/cpukit/libfs/src/imfs/imfs_symlink.c
index a6d2247e46..7094f219fb 100644
--- a/cpukit/libfs/src/imfs/imfs_symlink.c
+++ b/cpukit/libfs/src/imfs/imfs_symlink.c
@@ -40,13 +40,11 @@ int IMFS_symlink(
/*
* Remove any separators at the end of the string.
*/
-
IMFS_get_token( node_name, strlen( node_name ), new_name, &i );
/*
* Duplicate link name
*/
-
info.sym_link.name = strdup(link_name);
if (info.sym_link.name == NULL) {
rtems_set_errno_and_return_minus_one(ENOMEM);
@@ -55,13 +53,13 @@ int IMFS_symlink(
/*
* Create a new link node.
*
- * NOTE: Coverity CID 22 notes this as a resource leak. We are ignoring
- * this analysis because in this particular case it is wrong. This
- * method creates a symbolic link node for the IMFS. The memory
- * allocated must persist for the life of the symbolic link not
- * the life of the method.
+ * NOTE: Coverity CID 22 notes this as a resource 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_SYM_LINK,