Changeset 92119ed in rtems


Ignore:
Timestamp:
Jul 1, 2010, 3:12:38 PM (10 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, master
Children:
e72bc298
Parents:
98e16aad
Message:

2010-07-01 Jennifer Averett <Jennifer.Averett@…>

  • libcsupport/src/chdir.c, libcsupport/src/chmod.c, libcsupport/src/chown.c, libcsupport/src/close.c, libcsupport/src/eval.c, libcsupport/src/fchdir.c, libcsupport/src/fchmod.c, libcsupport/src/fchown.c, libcsupport/src/fcntl.c, libcsupport/src/fdatasync.c, libcsupport/src/freenode.c, libcsupport/src/fstat.c, libcsupport/src/fsync.c, libcsupport/src/ftruncate.c, libcsupport/src/ioctl.c, libcsupport/src/link.c, libcsupport/src/lseek.c, libcsupport/src/mknod.c, libcsupport/src/mount.c, libcsupport/src/open.c, libcsupport/src/read.c, libcsupport/src/readlink.c, libcsupport/src/readv.c, libcsupport/src/rmdir.c, libcsupport/src/stat.c, libcsupport/src/statvfs.c, libcsupport/src/symlink.c, libcsupport/src/unlink.c, libcsupport/src/unmount.c, libcsupport/src/write.c: Removed filesystem checks for NULL methods checks from the main posix rountines. These are now required to have at a miminum default routines in the tables.
Location:
cpukit
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r98e16aad r92119ed  
     12010-07-01      Jennifer Averett <Jennifer.Averett@OARcorp.com>
     2
     3        * libcsupport/src/chdir.c, libcsupport/src/chmod.c,
     4        libcsupport/src/chown.c, libcsupport/src/close.c,
     5        libcsupport/src/eval.c, libcsupport/src/fchdir.c,
     6        libcsupport/src/fchmod.c, libcsupport/src/fchown.c,
     7        libcsupport/src/fcntl.c, libcsupport/src/fdatasync.c,
     8        libcsupport/src/freenode.c, libcsupport/src/fstat.c,
     9        libcsupport/src/fsync.c, libcsupport/src/ftruncate.c,
     10        libcsupport/src/ioctl.c, libcsupport/src/link.c,
     11        libcsupport/src/lseek.c, libcsupport/src/mknod.c,
     12        libcsupport/src/mount.c, libcsupport/src/open.c,
     13        libcsupport/src/read.c, libcsupport/src/readlink.c,
     14        libcsupport/src/readv.c, libcsupport/src/rmdir.c,
     15        libcsupport/src/stat.c, libcsupport/src/statvfs.c,
     16        libcsupport/src/symlink.c, libcsupport/src/unlink.c,
     17        libcsupport/src/unmount.c, libcsupport/src/write.c: Removed
     18        filesystem checks for NULL methods checks from the main posix
     19        rountines. These are now required to have at a miminum default
     20        routines in the tables.
     21
    1222010-07-01      Sebastian Huber <sebastian.huber@embedded-brains.de>
    223
  • cpukit/libcsupport/src/chdir.c

    r98e16aad r92119ed  
    4545   * Verify you can change directory into this node.
    4646   */
    47   if ( !loc.ops->node_type_h ) {
    48     rtems_filesystem_freenode( &loc );
    49     rtems_set_errno_and_return_minus_one( ENOTSUP );
    50   }
    51 
    5247  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
    5348    rtems_filesystem_freenode( &loc );
  • cpukit/libcsupport/src/chmod.c

    r98e16aad r92119ed  
    3939    return -1;
    4040
    41   if ( !loc.handlers ){
    42     rtems_filesystem_freenode( &loc );
    43     rtems_set_errno_and_return_minus_one( EBADF );
    44   }
    45 
    46   if ( !loc.handlers->fchmod_h ){
    47     rtems_filesystem_freenode( &loc );
    48     rtems_set_errno_and_return_minus_one( ENOTSUP );
    49   }
    50 
    5141  result = (*loc.handlers->fchmod_h)( &loc, mode );
    5242
  • cpukit/libcsupport/src/chown.c

    r98e16aad r92119ed  
    3737    return -1;
    3838
    39   if ( !loc.ops->chown_h ) {
    40     rtems_filesystem_freenode( &loc );
    41     rtems_set_errno_and_return_minus_one( ENOTSUP );
    42   }
    43 
    4439  result = (*loc.ops->chown_h)( &loc, owner, group );
    4540
  • cpukit/libcsupport/src/close.c

    r98e16aad r92119ed  
    3030
    3131  rc = RTEMS_SUCCESSFUL;
    32   if ( iop->handlers->close_h )
    33     rc = (*iop->handlers->close_h)( iop );
     32  rc = (*iop->handlers->close_h)( iop );
    3433
    3534  rtems_filesystem_freenode( &iop->pathinfo );
  • cpukit/libcsupport/src/eval.c

    r98e16aad r92119ed  
    4343    rtems_set_errno_and_return_minus_one( EIO );       /* should never happen */
    4444
    45   if ( !pathloc->ops->evalpath_h )
    46     rtems_set_errno_and_return_minus_one( ENOTSUP );
    47 
    4845  result = (*pathloc->ops->evalpath_h)( pathname, pathnamelen, flags, pathloc );
    4946
     
    5552  if ( (result == 0) && follow_link ) {
    5653
    57     if ( !pathloc->ops->node_type_h ){
    58       rtems_filesystem_freenode( pathloc );
    59       rtems_set_errno_and_return_minus_one( ENOTSUP );
    60     }
    61 
    6254    type = (*pathloc->ops->node_type_h)( pathloc );
    6355
    6456    if ( ( type == RTEMS_FILESYSTEM_HARD_LINK ) ||
    6557         ( type == RTEMS_FILESYSTEM_SYM_LINK ) ) {
    66 
    67         if ( !pathloc->ops->eval_link_h ){
    68           rtems_filesystem_freenode( pathloc );
    69           rtems_set_errno_and_return_minus_one( ENOTSUP );
    70         }
    7158
    7259        /* what to do with the valid node pathloc points to
  • cpukit/libcsupport/src/fchdir.c

    r98e16aad r92119ed  
    4646   */
    4747
    48   if ( !iop->pathinfo.ops ) {
    49     rtems_set_errno_and_return_minus_one( ENOTSUP );
    50   }
    51 
    52   if ( !iop->pathinfo.ops->node_type_h ) {
    53     rtems_set_errno_and_return_minus_one( ENOTSUP );
    54   }
    55 
    5648  if (  (*iop->pathinfo.ops->node_type_h)( &iop->pathinfo ) !=
    5749                                          RTEMS_FILESYSTEM_DIRECTORY ) {
  • cpukit/libcsupport/src/fchmod.c

    r98e16aad r92119ed  
    4242  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
    4343
    44   if ( !iop->handlers->fchmod_h )
    45     rtems_set_errno_and_return_minus_one( ENOTSUP );
    46 
    4744  return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode );
    4845}
  • cpukit/libcsupport/src/fchown.c

    r98e16aad r92119ed  
    3939  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
    4040
    41   if ( !iop->pathinfo.ops->chown_h )
    42     rtems_set_errno_and_return_minus_one( ENOTSUP );
    43 
    4441  return (*iop->pathinfo.ops->chown_h)( &iop->pathinfo, owner, group );
    4542}
  • cpukit/libcsupport/src/fcntl.c

    r98e16aad r92119ed  
    141141
    142142  if (ret >= 0) {
    143     if (iop->handlers->fcntl_h) {
    144       int err = (*iop->handlers->fcntl_h)( cmd, iop );
    145       if (err) {
    146         errno = err;
    147         ret = -1;
    148       }
     143    int err = (*iop->handlers->fcntl_h)( cmd, iop );
     144    if (err) {
     145      errno = err;
     146      ret = -1;
    149147    }
    150148  }
  • cpukit/libcsupport/src/fdatasync.c

    r98e16aad r92119ed  
    3636   */
    3737
    38   if ( !iop->handlers->fdatasync_h )
    39     rtems_set_errno_and_return_minus_one( ENOTSUP );
    40 
    4138  return (*iop->handlers->fdatasync_h)( iop );
    4239}
  • cpukit/libcsupport/src/freenode.c

    r98e16aad r92119ed  
    1717void rtems_filesystem_freenode( rtems_filesystem_location_info_t *_node )
    1818{
    19   if ( _node->ops )
    20     if ( _node->ops->freenod_h )
    21       _node->ops->freenod_h(_node );
     19  _node->ops->freenod_h(_node );
    2220}
  • cpukit/libcsupport/src/fstat.c

    r98e16aad r92119ed  
    4545  rtems_libio_check_is_open(iop);
    4646
    47   if ( !iop->handlers )
    48     rtems_set_errno_and_return_minus_one( EBADF );
    49 
    50   if ( !iop->handlers->fstat_h )
    51     rtems_set_errno_and_return_minus_one( ENOTSUP );
    52 
    5347  /*
    5448   *  Zero out the stat structure so the various support
  • cpukit/libcsupport/src/fsync.c

    r98e16aad r92119ed  
    3636   */
    3737
    38   if ( !iop->handlers )
    39     rtems_set_errno_and_return_minus_one( EBADF );
    40 
    41   if ( !iop->handlers->fsync_h )
    42     rtems_set_errno_and_return_minus_one( ENOTSUP );
    43 
    4438  return (*iop->handlers->fsync_h)( iop );
    4539}
  • cpukit/libcsupport/src/ftruncate.c

    r98e16aad r92119ed  
    4343
    4444  loc = iop->pathinfo;
    45   if ( !loc.ops->node_type_h )
    46     rtems_set_errno_and_return_minus_one( ENOTSUP );
    47 
    4845  if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY )
    4946    rtems_set_errno_and_return_minus_one( EISDIR );
     
    5148  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
    5249
    53   if ( !iop->handlers->ftruncate_h )
    54     rtems_set_errno_and_return_minus_one( ENOTSUP );
    55 
    5650  return (*iop->handlers->ftruncate_h)( iop, length );
    5751}
  • cpukit/libcsupport/src/ioctl.c

    r98e16aad r92119ed  
    4848   *  Now process the ioctl().
    4949   */
    50 
    51   if ( !iop->handlers )
    52     rtems_set_errno_and_return_minus_one( EBADF );
    53 
    54   if ( !iop->handlers->ioctl_h )
    55     rtems_set_errno_and_return_minus_one( ENOTSUP );
    56 
    5750  rc = (*iop->handlers->ioctl_h)( iop, command, buffer );
    5851
  • cpukit/libcsupport/src/link.c

    r98e16aad r92119ed  
    4949  rtems_filesystem_get_start_loc( new, &i, &parent_loc );
    5050
    51   if ( !parent_loc.ops->evalformake_h ) {
    52     rtems_filesystem_freenode( &existing_loc );
    53     rtems_set_errno_and_return_minus_one( ENOTSUP );
    54   }
    55 
    5651  result = (*parent_loc.ops->evalformake_h)( &new[i], &parent_loc, &name_start );
    5752  if ( result != 0 ) {
     
    6964    rtems_filesystem_freenode( &parent_loc );
    7065    rtems_set_errno_and_return_minus_one( EXDEV );
    71   }
    72 
    73   if ( !parent_loc.ops->link_h ) {
    74     rtems_filesystem_freenode( &existing_loc );
    75     rtems_filesystem_freenode( &parent_loc );
    76     rtems_set_errno_and_return_minus_one( ENOTSUP );
    7766  }
    7867
  • cpukit/libcsupport/src/lseek.c

    r98e16aad r92119ed  
    3434  iop = rtems_libio_iop( fd );
    3535  rtems_libio_check_is_open(iop);
    36 
    37   /*
    38    *  Check as many errors as possible before touching iop->offset.
    39    */
    40 
    41   if ( !iop->handlers->lseek_h )
    42     rtems_set_errno_and_return_minus_one( ENOTSUP );
    4336
    4437  /*
  • cpukit/libcsupport/src/mknod.c

    r98e16aad r92119ed  
    4646  rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
    4747
    48   if ( !temp_loc.ops->evalformake_h ) {
    49     rtems_set_errno_and_return_minus_one( ENOTSUP );
    50   }
    51 
    5248  result = (*temp_loc.ops->evalformake_h)(
    5349    &pathname[i],
     
    5854    return -1;
    5955
    60   if ( !temp_loc.ops->mknod_h ) {
    61     rtems_filesystem_freenode( &temp_loc );
    62     rtems_set_errno_and_return_minus_one( ENOTSUP );
    63   }
    64 
    6556  result =  (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc );
    6657
  • cpukit/libcsupport/src/mount.c

    r98e16aad r92119ed  
    177177
    178178    /*
    179      * Test for node_type_h
    180      */
    181 
    182     if (!loc.ops->node_type_h) {
    183       errno =  ENOTSUP;
    184       goto cleanup_and_bail;
    185     }
    186 
    187     /*
    188179     *  Test to see if it is a directory
    189180     */
     
    221212     */
    222213
    223     if ( !loc.ops->mount_h ){
    224       errno = ENOTSUP;
    225       goto cleanup_and_bail;
    226     }
    227 
    228214    if ( loc.ops->mount_h( mt_entry ) ) {
    229215      goto cleanup_and_bail;
     
    249235     * Try to undo the mount operation
    250236     */
    251     if ( loc.ops->unmount_h ) {
    252       loc.ops->unmount_h( mt_entry );
    253     }
     237    loc.ops->unmount_h( mt_entry );
    254238    goto cleanup_and_bail;
    255239  }
  • cpukit/libcsupport/src/open.c

    r98e16aad r92119ed  
    159159  iop->pathinfo   = loc;
    160160
    161   if ( !iop->handlers || !iop->handlers->open_h ) {
    162     rc = ENOTSUP;
    163     goto done;
    164   }
    165 
    166161  rc = (*iop->handlers->open_h)( iop, pathname, flags, mode );
    167162  if ( rc ) {
  • cpukit/libcsupport/src/read.c

    r98e16aad r92119ed  
    4141   *  Now process the read().
    4242   */
    43   if ( !iop->handlers->read_h )
    44     rtems_set_errno_and_return_minus_one( ENOTSUP );
    45 
    4643  rc = (*iop->handlers->read_h)( iop, buffer, count );
    4744
  • cpukit/libcsupport/src/readlink.c

    r98e16aad r92119ed  
    3636     return -1;
    3737
    38   if ( !loc.ops->node_type_h ){
    39     rtems_filesystem_freenode( &loc );
    40     rtems_set_errno_and_return_minus_one( ENOTSUP );
    41   }
    42 
    4338  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){
    4439    rtems_filesystem_freenode( &loc );
    4540    rtems_set_errno_and_return_minus_one( EINVAL );
    46   }
    47 
    48   if ( !loc.ops->readlink_h ){
    49     rtems_filesystem_freenode( &loc );
    50     rtems_set_errno_and_return_minus_one( ENOTSUP );
    5141  }
    5242
  • cpukit/libcsupport/src/readv.c

    r98e16aad r92119ed  
    5454  if ( iovcnt > IOV_MAX )
    5555    rtems_set_errno_and_return_minus_one( EINVAL );
    56 
    57   if ( !iop->handlers->read_h )
    58     rtems_set_errno_and_return_minus_one( ENOTSUP );
    5956
    6057  /*
  • cpukit/libcsupport/src/rmdir.c

    r98e16aad r92119ed  
    7575   * Verify you can remove this node as a directory.
    7676   */
    77 
    78   if ( !loc.ops->node_type_h ){
    79     rtems_filesystem_freenode( &loc );
    80     if ( free_parentloc )
    81       rtems_filesystem_freenode( &parentloc );
    82     rtems_set_errno_and_return_minus_one( ENOTSUP );
    83   }
    84 
    8577  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
    8678    rtems_filesystem_freenode( &loc );
     
    9486   */
    9587
    96   if ( !loc.handlers->rmnod_h ){
    97     rtems_filesystem_freenode( &loc );
    98     if ( free_parentloc )
    99       rtems_filesystem_freenode( &parentloc );
    100     rtems_set_errno_and_return_minus_one( ENOTSUP );
    101   }
    102 
    10388  result =  (*loc.handlers->rmnod_h)( &parentloc, &loc );
    10489
  • cpukit/libcsupport/src/stat.c

    r98e16aad r92119ed  
    6363    return -1;
    6464
    65   if ( !loc.handlers->fstat_h ){
    66     rtems_filesystem_freenode( &loc );
    67     rtems_set_errno_and_return_minus_one( ENOTSUP );
    68   }
    69 
    7065  /*
    7166   *  Zero out the stat structure so the various support
  • cpukit/libcsupport/src/statvfs.c

    r98e16aad r92119ed  
    4343  fs_mount_root = &mt_entry->mt_fs_root;
    4444
    45   if ( !fs_mount_root->ops->statvfs_h )
    46     rtems_set_errno_and_return_minus_one( ENOTSUP );
    47 
    4845  memset (sb, 0, sizeof (struct statvfs));
    4946
  • cpukit/libcsupport/src/symlink.c

    r98e16aad r92119ed  
    3131  rtems_filesystem_get_start_loc( sympath, &i, &loc );
    3232
    33   if ( !loc.ops->evalformake_h ) {
    34     rtems_set_errno_and_return_minus_one( ENOTSUP );
    35   }
    36 
    3733  result = (*loc.ops->evalformake_h)( &sympath[i], &loc, &name_start );
    3834  if ( result != 0 )
    3935    return -1;
    40 
    41   if ( !loc.ops->symlink_h ) {
    42     rtems_filesystem_freenode( &loc );
    43     rtems_set_errno_and_return_minus_one( ENOTSUP );
    44   }
    4536
    4637  result = (*loc.ops->symlink_h)( &loc, actualpath, name_start);
  • cpukit/libcsupport/src/unlink.c

    r98e16aad r92119ed  
    6868  }
    6969
    70   if ( !loc.ops->node_type_h ) {
    71     rtems_filesystem_freenode( &loc );
    72     if ( free_parentloc )
    73       rtems_filesystem_freenode( &parentloc );
    74     rtems_set_errno_and_return_minus_one( ENOTSUP );
    75   }
    76 
    7770  if (  (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) {
    7871    rtems_filesystem_freenode( &loc );
  • cpukit/libcsupport/src/unmount.c

    r98e16aad r92119ed  
    8989
    9090  /*
    91    * Verify Unmount is supported by both filesystems.
    92    */
    93 
    94   if ( !fs_mount_loc->ops->unmount_h )
    95     rtems_set_errno_and_return_minus_one( ENOTSUP );
    96 
    97   if ( !fs_root_loc->ops->fsunmount_me_h )
    98     rtems_set_errno_and_return_minus_one( ENOTSUP );
    99 
    100 
    101   /*
    10291   *  Verify the current node is not in this filesystem.
    10392   *  XXX - Joel I have a question here wasn't code added
  • cpukit/libcsupport/src/write.c

    r98e16aad r92119ed  
    4848   *  Now process the write() request.
    4949   */
    50   if ( !iop->handlers->write_h )
    51     rtems_set_errno_and_return_minus_one( ENOTSUP );
    52 
    5350  rc = (*iop->handlers->write_h)( iop, buffer, count );
    5451
Note: See TracChangeset for help on using the changeset viewer.