Changeset b22ff782 in rtems


Ignore:
Timestamp:
Apr 13, 2012, 8:01:51 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Children:
9502079
Parents:
a47f70c
Message:

Filesystem: Remove NULL pointer check

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/pipe/fifo.c

    ra47f70c rb22ff782  
    623623  int rv = 0;
    624624
    625   if (buffer != NULL) {
    626     if (PIPE_LOCK(pipe)) {
    627       switch (cmd) {
    628         case RTEMS_IOCTL_SELECT:
    629           rv = pipe_select(pipe, buffer);
    630           break;
    631         case FIONREAD:
    632           /* Return length of pipe */
    633           *(unsigned int *) buffer = pipe->Length;
    634           break;
    635       }
    636 
    637       PIPE_UNLOCK(pipe);
    638     } else {
    639       rv = -EINTR;
    640     }
     625  if (PIPE_LOCK(pipe)) {
     626    switch (cmd) {
     627      case RTEMS_IOCTL_SELECT:
     628        rv = pipe_select(pipe, buffer);
     629        break;
     630      case FIONREAD:
     631        /* Return length of pipe */
     632        *(unsigned int *) buffer = pipe->Length;
     633        break;
     634      default:
     635        rv = -EINVAL;
     636        break;
     637    }
     638
     639    PIPE_UNLOCK(pipe);
    641640  } else {
    642     rv = -EFAULT;
     641    rv = -EINTR;
    643642  }
    644643
  • testsuites/sptests/spfifo04/init.c

    ra47f70c rb22ff782  
    5353  rtems_test_assert( errno == ESPIPE );
    5454
    55   puts( "Init - ioctl: FIONBIO -- Expected EFAULT" );
    56   status = ioctl( fd, FIONBIO, NULL );
    57   rtems_test_assert( status == -1 );
    58   rtems_test_assert( errno == EFAULT );
    59 
    6055  puts( "Init - ioctl: FIONBIO -- OK" );
    6156  status = ioctl( fd, FIONBIO, &flag );
     
    6863
    6964  puts( "Init - ioctl: Dummy Command -- Expected EINVAL" );
    70   status = ioctl( fd, -1, NULL );
     65  status = ioctl( fd, -1 );
    7166  rtems_test_assert( status == -1 );
    7267  rtems_test_assert( errno == EINVAL );
    73 
    74   puts( "Init - ioctl: FIONREAD -- Expected EFAULT" );
    75   status = ioctl( fd, FIONREAD, NULL );
    76   rtems_test_assert( status == -1 );
    77   rtems_test_assert( errno == EFAULT );
    7868
    7969  puts( "Init - ioctl: FIONREAD -- OK" );
Note: See TracChangeset for help on using the changeset viewer.