Changeset 3d3a18e6 in rtems for cpukit/libcsupport/src/mount.c


Ignore:
Timestamp:
Jul 1, 2010, 2:39:39 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10
Children:
e8cec9e
Parents:
615d8cc
Message:

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/unmount.c: Removed obsolete declarations. Fixed invalid memory free.

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Removed rtems_ftpfs_mount().

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • 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@…>

  • libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Added rtems_ftpfs_mount() again. Documentation.

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added and use defines for file system types.

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/mount.c: Fixed NULL pointer access.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/mount.c

    r615d8cc r3d3a18e6  
    9494
    9595static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
    96   const char *source,
    97   const char *target,
     96  const char *source_or_null,
     97  const char *target_or_null,
    9898  const char *filesystemtype,
    9999  size_t *target_length_ptr
    100100)
    101101{
    102   const char *target_str = target ? target : "/";
     102  const char *target = target_or_null != NULL ? target_or_null : "/";
    103103  size_t filesystemtype_size = strlen( filesystemtype ) + 1;
    104   size_t source_size = source ? strlen( source ) + 1 : 0;
    105   size_t target_length = strlen( target_str );
     104  size_t source_size = source_or_null != NULL ?
     105    strlen( source_or_null ) + 1 : 0;
     106  size_t target_length = strlen( target );
    106107  size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
    107108    + filesystemtype_size + source_size + target_length + 1;
    108109  rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
    109110
    110   if ( mt_entry ) {
     111  if ( mt_entry != NULL ) {
    111112    char *str = (char *) mt_entry + sizeof( *mt_entry );
    112113
     
    114115    strcpy( str, filesystemtype );
    115116
    116     if ( source ) {
     117    if ( source_or_null != NULL ) {
    117118      str += filesystemtype_size;
    118119      mt_entry->dev = str;
    119       strcpy( str, source );
     120      strcpy( str, source_or_null );
    120121    }
    121122
Note: See TracChangeset for help on using the changeset viewer.