Changeset efb5450 in rtems


Ignore:
Timestamp:
Oct 17, 2001, 5:57:42 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
606d797c
Parents:
080afec
Message:

2001-10-17 Till Straumann <strauman@…>

  • These changes were discussed and reviewed by many people but the primary people were Jennifer Averett <jennifer@…> and Eugeny Mints <jack@…>.
  • libc/utime.c: Add missing call to rtems_filesystem_freenode() at verification that utime is supported by the filesystem.
  • libc/link.c: Remove calls to freenode when the node was not successfully allocated.
  • libc/unmount.c: In the method file_systems_below_this_mountpoint() added calls to correctly free fs_root_loc when a failure occurs.
  • libc/open.c: Add freenode calls upon failure.
  • libc/open.c, lib/libc/close.c: (PENDING -- NOT INCLUDED THIS TIMER) Modifications the move the freenode from open() to close() (also part of this patch) are pending further discussion.
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/src/link.c

    r080afec refb5450  
    4949  if ( !parent_loc.ops->evalformake_h ) {
    5050    rtems_filesystem_freenode( &existing_loc );
    51     rtems_filesystem_freenode( &parent_loc );
    5251    set_errno_and_return_minus_one( ENOTSUP );
    5352  }
     
    5655  if ( result != 0 ) {
    5756    rtems_filesystem_freenode( &existing_loc );
    58     rtems_filesystem_freenode( &parent_loc );
    5957    set_errno_and_return_minus_one( result );
    6058  }
  • c/src/exec/libcsupport/src/open.c

    r080afec refb5450  
    6767  int                                 status;
    6868  rtems_filesystem_location_info_t    loc;
     69  rtems_filesystem_location_info_t   *loc_to_free = NULL;
    6970  int                                 eval_flags;
    7071
     
    139140    /* We were trying to create a file that already exists */
    140141    rc = EEXIST;
     142    loc_to_free = &loc;
    141143    goto done;
    142144  }
     145
     146  loc_to_free = &loc;
    143147
    144148  /*
     
    179183    if ( iop )
    180184      rtems_libio_free( iop );
     185    if ( loc_to_free )
     186      rtems_filesystem_freenode( loc_to_free );
    181187    set_errno_and_return_minus_one( rc );
    182188  }
  • c/src/exec/libcsupport/src/unmount.c

    r080afec refb5450  
    169169
    170170  *fs_to_unmount = *fs_root_loc->mt_entry;
    171   if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access )
     171  if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access ){
     172    rtems_filesystem_freenode(fs_root_loc);
    172173    set_errno_and_return_minus_one( EACCES );
     174  }
    173175
    174176  /*
     
    182184     the_mount_entry = ( rtems_filesystem_mount_table_entry_t * )the_node;
    183185     if (the_mount_entry->mt_point_node.mt_entry  == fs_root_loc->mt_entry ) {
    184           set_errno_and_return_minus_one( EBUSY );
     186        rtems_filesystem_freenode(fs_root_loc); 
     187        set_errno_and_return_minus_one( EBUSY );
    185188     }
    186189  }
  • c/src/exec/libcsupport/src/utime.c

    r080afec refb5450  
    3333    return -1;
    3434
    35   if ( !temp_loc.ops->utime_h )
     35  if ( !temp_loc.ops->utime_h ){
     36    rtems_filesystem_freenode( &temp_loc );
    3637    set_errno_and_return_minus_one( ENOTSUP );
     38  }
    3739
    3840  result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime );
  • c/src/lib/ChangeLog

    r080afec refb5450  
     12001-10-17      Till Straumann <strauman@SLAC.Stanford.EDU>
     2               
     3        * These changes were discussed and reviewed by many people but the
     4        primary people were Jennifer Averett <jennifer@OARcorp.com>
     5        and Eugeny Mints <jack@oktet.ru>.
     6        * libc/utime.c: Add missing call to rtems_filesystem_freenode()
     7        at verification that utime is supported by the filesystem.
     8        * libc/link.c: Remove calls to freenode when the node was
     9        not successfully allocated.
     10        * libc/unmount.c: In the method file_systems_below_this_mountpoint()
     11        added calls to correctly free fs_root_loc when a failure occurs.
     12        * libc/open.c: Add freenode calls upon failure.
     13        * libc/open.c, lib/libc/close.c: (PENDING -- NOT INCLUDED THIS TIMER)
     14        Modifications the move the freenode from open() to close() (also part
     15        of this patch) are pending further discussion.
     16
    1172001-10-16      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    218
  • c/src/lib/libc/link.c

    r080afec refb5450  
    4949  if ( !parent_loc.ops->evalformake_h ) {
    5050    rtems_filesystem_freenode( &existing_loc );
    51     rtems_filesystem_freenode( &parent_loc );
    5251    set_errno_and_return_minus_one( ENOTSUP );
    5352  }
     
    5655  if ( result != 0 ) {
    5756    rtems_filesystem_freenode( &existing_loc );
    58     rtems_filesystem_freenode( &parent_loc );
    5957    set_errno_and_return_minus_one( result );
    6058  }
  • c/src/lib/libc/open.c

    r080afec refb5450  
    6767  int                                 status;
    6868  rtems_filesystem_location_info_t    loc;
     69  rtems_filesystem_location_info_t   *loc_to_free = NULL;
    6970  int                                 eval_flags;
    7071
     
    139140    /* We were trying to create a file that already exists */
    140141    rc = EEXIST;
     142    loc_to_free = &loc;
    141143    goto done;
    142144  }
     145
     146  loc_to_free = &loc;
    143147
    144148  /*
     
    179183    if ( iop )
    180184      rtems_libio_free( iop );
     185    if ( loc_to_free )
     186      rtems_filesystem_freenode( loc_to_free );
    181187    set_errno_and_return_minus_one( rc );
    182188  }
  • c/src/lib/libc/unmount.c

    r080afec refb5450  
    169169
    170170  *fs_to_unmount = *fs_root_loc->mt_entry;
    171   if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access )
     171  if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access ){
     172    rtems_filesystem_freenode(fs_root_loc);
    172173    set_errno_and_return_minus_one( EACCES );
     174  }
    173175
    174176  /*
     
    182184     the_mount_entry = ( rtems_filesystem_mount_table_entry_t * )the_node;
    183185     if (the_mount_entry->mt_point_node.mt_entry  == fs_root_loc->mt_entry ) {
    184           set_errno_and_return_minus_one( EBUSY );
     186        rtems_filesystem_freenode(fs_root_loc); 
     187        set_errno_and_return_minus_one( EBUSY );
    185188     }
    186189  }
  • c/src/lib/libc/utime.c

    r080afec refb5450  
    3333    return -1;
    3434
    35   if ( !temp_loc.ops->utime_h )
     35  if ( !temp_loc.ops->utime_h ){
     36    rtems_filesystem_freenode( &temp_loc );
    3637    set_errno_and_return_minus_one( ENOTSUP );
     38  }
    3739
    3840  result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime );
  • cpukit/libcsupport/src/link.c

    r080afec refb5450  
    4949  if ( !parent_loc.ops->evalformake_h ) {
    5050    rtems_filesystem_freenode( &existing_loc );
    51     rtems_filesystem_freenode( &parent_loc );
    5251    set_errno_and_return_minus_one( ENOTSUP );
    5352  }
     
    5655  if ( result != 0 ) {
    5756    rtems_filesystem_freenode( &existing_loc );
    58     rtems_filesystem_freenode( &parent_loc );
    5957    set_errno_and_return_minus_one( result );
    6058  }
  • cpukit/libcsupport/src/open.c

    r080afec refb5450  
    6767  int                                 status;
    6868  rtems_filesystem_location_info_t    loc;
     69  rtems_filesystem_location_info_t   *loc_to_free = NULL;
    6970  int                                 eval_flags;
    7071
     
    139140    /* We were trying to create a file that already exists */
    140141    rc = EEXIST;
     142    loc_to_free = &loc;
    141143    goto done;
    142144  }
     145
     146  loc_to_free = &loc;
    143147
    144148  /*
     
    179183    if ( iop )
    180184      rtems_libio_free( iop );
     185    if ( loc_to_free )
     186      rtems_filesystem_freenode( loc_to_free );
    181187    set_errno_and_return_minus_one( rc );
    182188  }
  • cpukit/libcsupport/src/unmount.c

    r080afec refb5450  
    169169
    170170  *fs_to_unmount = *fs_root_loc->mt_entry;
    171   if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access )
     171  if ( fs_to_unmount->mt_fs_root.node_access != fs_root_loc->node_access ){
     172    rtems_filesystem_freenode(fs_root_loc);
    172173    set_errno_and_return_minus_one( EACCES );
     174  }
    173175
    174176  /*
     
    182184     the_mount_entry = ( rtems_filesystem_mount_table_entry_t * )the_node;
    183185     if (the_mount_entry->mt_point_node.mt_entry  == fs_root_loc->mt_entry ) {
    184           set_errno_and_return_minus_one( EBUSY );
     186        rtems_filesystem_freenode(fs_root_loc); 
     187        set_errno_and_return_minus_one( EBUSY );
    185188     }
    186189  }
  • cpukit/libcsupport/src/utime.c

    r080afec refb5450  
    3333    return -1;
    3434
    35   if ( !temp_loc.ops->utime_h )
     35  if ( !temp_loc.ops->utime_h ){
     36    rtems_filesystem_freenode( &temp_loc );
    3637    set_errno_and_return_minus_one( ENOTSUP );
     38  }
    3739
    3840  result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime );
Note: See TracChangeset for help on using the changeset viewer.