summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/mount.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-07-01 14:39:39 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-07-01 14:39:39 +0000
commit3d3a18e619ce62485d3508a6b7dd1467c912bbad (patch)
treeeeb9b9d70190c395460d0511c0c048efc883d5c0 /cpukit/libcsupport/src/mount.c
parent2010-06-08 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-3d3a18e619ce62485d3508a6b7dd1467c912bbad.tar.bz2
2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/unmount.c: Removed obsolete declarations. Fixed invalid memory free. 2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de> * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Removed rtems_ftpfs_mount(). 2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de> * libcsupport/src/mount-mktgt.c: New file. * libcsupport/Makefile.am: Reflect change above. * libcsupport/include/rtems/libio.h: Declare mount_and_make_target_path(). 2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de> * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Added rtems_ftpfs_mount() again. Documentation. 2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de> * libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added and use defines for file system types. 2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de> * libcsupport/src/mount.c: Fixed NULL pointer access.
Diffstat (limited to 'cpukit/libcsupport/src/mount.c')
-rw-r--r--cpukit/libcsupport/src/mount.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/cpukit/libcsupport/src/mount.c b/cpukit/libcsupport/src/mount.c
index 07f41f2ee4..c73ce89e35 100644
--- a/cpukit/libcsupport/src/mount.c
+++ b/cpukit/libcsupport/src/mount.c
@@ -93,30 +93,31 @@ static bool Is_node_fs_root(
}
static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
- const char *source,
- const char *target,
+ const char *source_or_null,
+ const char *target_or_null,
const char *filesystemtype,
size_t *target_length_ptr
)
{
- const char *target_str = target ? target : "/";
+ const char *target = target_or_null != NULL ? target_or_null : "/";
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
- size_t source_size = source ? strlen( source ) + 1 : 0;
- size_t target_length = strlen( target_str );
+ size_t source_size = source_or_null != NULL ?
+ strlen( source_or_null ) + 1 : 0;
+ size_t target_length = strlen( target );
size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
+ filesystemtype_size + source_size + target_length + 1;
rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
- if ( mt_entry ) {
+ if ( mt_entry != NULL ) {
char *str = (char *) mt_entry + sizeof( *mt_entry );
mt_entry->type = str;
strcpy( str, filesystemtype );
- if ( source ) {
+ if ( source_or_null != NULL ) {
str += filesystemtype_size;
mt_entry->dev = str;
- strcpy( str, source );
+ strcpy( str, source_or_null );
}
str += source_size;