summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs/imfs_link.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_link.c')
-rw-r--r--cpukit/libfs/src/imfs/imfs_link.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_link.c b/cpukit/libfs/src/imfs/imfs_link.c
index c7dc6475f9..130c529d75 100644
--- a/cpukit/libfs/src/imfs/imfs_link.c
+++ b/cpukit/libfs/src/imfs/imfs_link.c
@@ -16,51 +16,36 @@
*/
#if HAVE_CONFIG_H
-#include "config.h"
+ #include "config.h"
#endif
-#include <errno.h>
#include "imfs.h"
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
int IMFS_link(
- rtems_filesystem_location_info_t *to_loc, /* IN */
- rtems_filesystem_location_info_t *parent_loc, /* IN */
- const char *token /* IN */
+ const rtems_filesystem_location_info_t *parentloc,
+ const rtems_filesystem_location_info_t *targetloc,
+ const char *name,
+ size_t namelen
)
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ IMFS_NAME_MAX + 1 ];
- int i;
/*
* Verify this node can be linked to.
*/
- info.hard_link.link_node = to_loc->node_access;
+ info.hard_link.link_node = targetloc->node_access;
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
rtems_set_errno_and_return_minus_one( EMLINK );
/*
- * 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 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,
+ parentloc,
IMFS_HARD_LINK,
- new_name,
+ name,
+ namelen,
( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )),
&info
);