Changeset ec0f2df in rtems


Ignore:
Timestamp:
Feb 2, 2015, 2:25:25 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
efd2965a
Parents:
97db9e30
git-author:
Sebastian Huber <sebastian.huber@…> (02/02/15 14:25:25)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/04/15 13:03:49)
Message:

Filesystem: Use rtems_libio_iop_to_descriptor()

Drop parameter check from previously unused
rtems_libio_iop_to_descriptor().

Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/include/rtems/libio_.h

    r97db9e30 rec0f2df  
    108108
    109109#define rtems_libio_iop_to_descriptor(_iop) \
    110    ((!(_iop)) ? -1 : (_iop - rtems_libio_iops))
     110  ((_iop) - &rtems_libio_iops[0])
    111111
    112112/*
  • cpukit/libcsupport/src/fcntl.c

    r97db9e30 rec0f2df  
    4848    rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 );
    4949    if ( rv == 0 ) {
    50       rv = diop - rtems_libio_iops;
     50      rv = rtems_libio_iop_to_descriptor( diop );
    5151    } else {
    5252      rtems_libio_free( diop );
  • cpukit/libcsupport/src/open.c

    r97db9e30 rec0f2df  
    6767{
    6868  int rv = 0;
    69   int fd = iop - rtems_libio_iops;
     69  int fd = rtems_libio_iop_to_descriptor( iop );
    7070  int rwflag = oflag + 1;
    7171  bool read_access = (rwflag & _FREAD) == _FREAD;
  • cpukit/libnetworking/rtems/rtems_syscall.c

    r97db9e30 rec0f2df  
    8484      rtems_set_errno_and_return_minus_one( ENFILE );
    8585
    86   fd = iop - rtems_libio_iops;
     86  fd = rtems_libio_iop_to_descriptor(iop);
    8787  iop->flags |= LIBIO_FLAGS_WRITE | LIBIO_FLAGS_READ;
    8888  iop->data0 = fd;
Note: See TracChangeset for help on using the changeset viewer.