diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2008-05-27 10:34:15 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2008-05-27 10:34:15 +0000 |
commit | bf95ccb5068543b453c1dfbf5e8ae7b6c814e1e4 (patch) | |
tree | e1ce92224d77dd59b5d6227c2c800c19d90ae605 /cpukit/libfs/src/imfs/imfs_symlink.c | |
parent | Bugfix: Moved definition of ppp_softc into source file. (diff) | |
download | rtems-bf95ccb5068543b453c1dfbf5e8ae7b6c814e1e4.tar.bz2 |
Added const qualifier to various pointers and data tables to
reduce size of data area.
IMFS: Fixed creation of symbolic links to avoid a compiler warning.
DOSFS: Use LibBlock instead of read() to read the boot record.
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_symlink.c')
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_symlink.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_symlink.c b/cpukit/libfs/src/imfs/imfs_symlink.c index 38072b9f69..e946f3dc66 100644 --- a/cpukit/libfs/src/imfs/imfs_symlink.c +++ b/cpukit/libfs/src/imfs/imfs_symlink.c @@ -20,6 +20,8 @@ #endif #include <errno.h> +#include <string.h> +#include <stdlib.h> #include "imfs.h" #include <rtems/libio_.h> #include <rtems/seterr.h> @@ -41,7 +43,14 @@ int IMFS_symlink( IMFS_get_token( node_name, new_name, &i ); - info.sym_link.name = link_name; + /* + * Duplicate link name + */ + + info.sym_link.name = strdup( link_name); + if (info.sym_link.name == NULL) { + rtems_set_errno_and_return_minus_one( ENOMEM); + } /* * Create a new link node. @@ -55,8 +64,10 @@ int IMFS_symlink( &info ); - if ( !new_node ) - rtems_set_errno_and_return_minus_one( ENOMEM ); + if (new_node == NULL) { + free( info.sym_link.name); + rtems_set_errno_and_return_minus_one( ENOMEM); + } return 0; } |