Changeset 74835d7 in rtems


Ignore:
Timestamp:
Aug 11, 2000, 8:04:03 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
0b18036
Parents:
289f822
Message:

2000-08-11 Chris Johns <ccj@…>

  • libc/chmod.c: Return ENOTSUP if filesystem does not have handler.
  • libc/eval.c: Ditto.
  • libc/fcntl.c: Ditto.
  • libc/fsync.c: Ditto.
  • libc/ioctl.c: Ditto.
  • libc/ioman.c: Ditto.
  • libc/link.c: Ditto.
  • libc/memfile.c: Ditto.
  • libc/mknod.c: Ditto.
  • libc/symlink.c: Ditto.
  • libc/libio.h(rtems_filesystem_dev_major_t): New macro.
  • libc/libio.h(rtems_filesystem_dev_minor_t): New macro.
Location:
c/src/lib/libc
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libc/chmod.c

    r289f822 r74835d7  
    3434    return -1;
    3535 
     36  if ( !loc.handlers ){
     37    rtems_filesystem_freenode( &loc );
     38    set_errno_and_return_minus_one( EBADF );
     39  }
     40
    3641  if ( !loc.handlers->fchmod ){
    3742    rtems_filesystem_freenode( &loc );
  • c/src/lib/libc/eval.c

    r289f822 r74835d7  
    4444  rtems_filesystem_get_start_loc( pathname, &i, pathloc );
    4545
     46  if ( !pathloc->ops->evalpath )
     47    set_errno_and_return_minus_one( ENOTSUP );
     48
    4649  result = (*pathloc->ops->evalpath)( &pathname[i], flags, pathloc );
    4750
  • c/src/lib/libc/fcntl.c

    r289f822 r74835d7  
    132132      break;
    133133  }
    134   if ((ret >= 0) && iop->handlers->fcntl) {
    135     int err = (*iop->handlers->fcntl)( cmd, iop );
    136     if (err) {
    137       errno = err;
     134  if (ret >= 0) {   
     135    if (iop->handlers->fcntl) {
     136      int err = (*iop->handlers->fcntl)( cmd, iop );
     137      if (err) {
     138        errno = err;
     139        ret = -1;
     140      }
     141    }
     142    else {
     143      errno = ENOTSUP;
    138144      ret = -1;
    139145    }
  • c/src/lib/libc/fsync.c

    r289f822 r74835d7  
    3131   */
    3232
     33  if ( !iop->handlers )
     34    set_errno_and_return_minus_one( EBADF );
     35
    3336  if ( !iop->handlers->fsync )
    3437    set_errno_and_return_minus_one( ENOTSUP );
  • c/src/lib/libc/ioctl.c

    r289f822 r74835d7  
    3434   */
    3535
     36  if ( !iop->handlers )
     37    set_errno_and_return_minus_one( EBADF );
     38
    3639  if ( !iop->handlers->ioctl )
    3740    set_errno_and_return_minus_one( ENOTSUP );
  • c/src/lib/libc/ioman.c

    r289f822 r74835d7  
    8181  the_jnode = loc.node_access;
    8282
     83  if ( !loc.ops->node_type ) {
     84    rtems_filesystem_freenode( &loc );
     85    set_errno_and_return_minus_one( ENOTSUP );
     86  }
     87
    8388  node_type = (*loc.ops->node_type)( &loc );
    8489
  • c/src/lib/libc/libio.h

    r289f822 r74835d7  
    474474  ((((dev_t)(_major)) << 32) | (dev_t)(_minor))
    475475
     476#define rtems_filesystem_dev_major_t( _dev ) \
     477  (rtems_device_major_number) ((_dev) >> 32)
     478
     479#define rtems_filesystem_dev_minor_t( _dev ) \
     480  (rtems_device_minor_number) ((_dev) & 0xFFFFFFFF)
     481
    476482#define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
    477483  do { \
    478     (_major) = (rtems_device_major_number) ((_dev) >> 32); \
    479     (_minor) = (rtems_device_minor_number) ((_dev) & 0xFFFFFFFF); \
     484    (_major) = rtems_filesystem_dev_major_t ( _dev ); \
     485    (_minor) = rtems_filesystem_dev_minor_t( _dev ); \
    480486  } while(0)
    481487
  • c/src/lib/libc/link.c

    r289f822 r74835d7  
    4242
    4343  rtems_filesystem_get_start_loc( new, &i, &parent_loc );
     44
     45  if ( !parent_loc.ops->evalformake ) {
     46    rtems_filesystem_freenode( &existing_loc );
     47    rtems_filesystem_freenode( &parent_loc );
     48    set_errno_and_return_minus_one( ENOTSUP );
     49  }
     50
    4451  result = (*parent_loc.ops->evalformake)( &new[i], &parent_loc, &name_start );
    4552  if ( result != 0 ) {
     53    rtems_filesystem_freenode( &existing_loc );
    4654    rtems_filesystem_freenode( &parent_loc );
    4755    set_errno_and_return_minus_one( result );
  • c/src/lib/libc/memfile.c

    r289f822 r74835d7  
    112112
    113113  the_jnode = iop->file_info;
     114
     115  if (iop->flags & LIBIO_FLAGS_APPEND)
     116    iop->offset = the_jnode->info.file.size;
    114117
    115118  return 0;
     
    341344
    342345  memory = memfile_alloc_block();
    343   assert( memory );
    344346  if ( !memory )
    345347    return 1;
  • c/src/lib/libc/mknod.c

    r289f822 r74835d7  
    4444  rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
    4545
     46  if ( !temp_loc.ops->evalformake ) {
     47    rtems_filesystem_freenode( &temp_loc );
     48    set_errno_and_return_minus_one( ENOTSUP );
     49  }
     50
    4651  result = (*temp_loc.ops->evalformake)(
    4752    &pathname[i],
  • c/src/lib/libc/symlink.c

    r289f822 r74835d7  
    2929    return -1;
    3030
     31  if ( !loc.ops->symlink ) {
     32    rtems_filesystem_freenode( &loc );
     33    set_errno_and_return_minus_one( ENOTSUP );
     34  }
     35
    3136  result = (*loc.ops->symlink)( &loc, actualpath, name_start);
    3237
Note: See TracChangeset for help on using the changeset viewer.