Ticket #1838: pr1838.diff

File pr1838.diff, 5.0 KB (added by Joel Sherrill, on Jul 18, 2011 at 6:21:55 PM)

Patch v1

  • cpukit/libcsupport/src/fchmod.c

    ? testsuites/psxtests/psxfchx01/.psxfchx01.scn.swp
    RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/fchmod.c,v
    retrieving revision 1.13
    diff -u -r1.13 fchmod.c
     
    11/*
    22 *  fchmod() - POSIX 1003.1b 5.6.4 - Change File Modes
    33 *
    4  *  COPYRIGHT (c) 1989-1999.
     4 *  COPYRIGHT (c) 1989-2011.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
    77 *  The license and distribution terms for this file may be
     
    3838  /*
    3939   *  Now process the fchmod().
    4040   */
    41 
    42   rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
    43 
    4441  return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode );
    4542}
  • testsuites/psxtests/psxfchx01/init.c

    RCS file: /usr1/CVS/rtems/testsuites/psxtests/psxfchx01/init.c,v
    retrieving revision 1.2
    diff -u -r1.2 init.c
     
    11/*
    2  *  COPYRIGHT (c) 1989-2010.
     2 *  COPYRIGHT (c) 1989-2011.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
    55 *  The license and distribution terms for this file may be
     
    5555  rtems_test_assert( status == -1 );
    5656  rtems_test_assert( errno == EINVAL );
    5757
    58   puts(" Init - closing /newfile -- OK" );
     58  puts( "Init - closing /newfile -- OK" );
    5959  status = close( fd );
    6060  rtems_test_assert( status == 0 );
    6161
     
    140140  fd = open( "/newfile", O_RDONLY | O_CREAT, S_IRWXU );
    141141  rtems_test_assert( fd != -1 );
    142142 
    143   puts( "Init - fchmod, with the opened file descriptor - expect EINVAL" );
     143  puts( "Init - fchmod, with the opened file descriptor -- OK" );
    144144  status = fchmod( fd, 0 );
    145   rtems_test_assert( status == -1 );
    146   rtems_test_assert( errno == EINVAL );
     145  rtems_test_assert( status == 0 );
    147146
    148   puts(" Init - close and remove /newfile" );
     147  puts( "Init - close and remove /newfile" );
    149148  status = close( fd );
    150149  status |= unlink( "/newfile" );
    151150  rtems_test_assert( status == 0 );
     
    158157  status = fchmod( fd, S_IRUSR );
    159158  rtems_test_assert( status == 0 );
    160159
    161   puts(" Init - close and remove /newfile -- OK" );
     160  puts( "Init - close and remove /newfile -- OK" );
    162161  status = close( fd );
    163162  status |= unlink( "/newfile" );
    164163  rtems_test_assert( status == 0 );
     
    190189  rtems_test_assert( status == -1 );
    191190  rtems_test_assert( errno == EINVAL );
    192191
    193   puts(" Init - close and remove /newfile" );
     192  puts( "Init - close and remove /newfile" );
    194193  status = close( fd );
    195194  status |= unlink( "/newfile" );
    196195  rtems_test_assert( status == 0 );
     
    203202  status = fchown( fd, 1, 0 );
    204203  rtems_test_assert( status == 0 );
    205204
    206   puts(" Init - close and remove /newfile -- OK" );
     205  puts( "Init - close and remove /newfile -- OK" );
    207206  status = close( fd );
    208207  status |= unlink( "/newfile" );
    209208  rtems_test_assert( status == 0 );
  • testsuites/psxtests/psxfchx01/psxfchx01.scn

    RCS file: /usr1/CVS/rtems/testsuites/psxtests/psxfchx01/psxfchx01.scn,v
    retrieving revision 1.1
    diff -u -r1.1 psxfchx01.scn
     
    44Init - Attempt fchdir with bad file descriptor - expect EBADF
    55Init - opening /newfile in write-mode -- OK
    66Init - fchdir on the file descriptor - expect EINVAL
    7  Init - closing /newfile -- OK
     7Init - closing /newfile -- OK
    88Init - removing /newfile -- OK
    99Init - opening /newfile in read-mode -- OK
    1010Init - fchdir on the file descriptor - expect ENOTDIR
     
    2525Init - fchmod, with a bad file descriptor - expect EBADF
    2626Init - fchmod, with an unopened file descriptor - expect EBADF
    2727Init - open new file: /newfile in read-only mode -- OK
    28 Init - fchmod, with the opened file descriptor - expect EINVAL
    29  Init - close and remove /newfile
     28Init - fchmod, with the opened file descriptor -- OK
     29Init - close and remove /newfile
    3030Init - open new file: /newfile in read-write mode -- OK
    3131Init - fchmod, with the opened file descriptor -- OK
    32  Init - close and remove /newfile -- OK
     32Init - close and remove /newfile -- OK
    3333End of fchmod tests
    3434
    3535Init - fchown tests
     
    3737Init - fchown, with an unopened file descriptor - expect EBADF
    3838Init - open new file: /newfile in read-only mode -- OK
    3939Init - fchown, with the opened file descriptor - expect EINVAL
    40  Init - close and remove /newfile
     40Init - close and remove /newfile
    4141Init - open new file: /newfile in read-write mode -- OK
    4242Init - fchown, with the opened file descriptor -- OK
    43  Init - close and remove /newfile -- OK
     43Init - close and remove /newfile -- OK
    4444End of fchown tests
    4545*** END OF TEST Posix file op tests - 01 ***