From 4f6cff8dbf28b6319b9f125ff7239774bb87e5d4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 19 Jul 2011 13:10:46 +0000 Subject: 2011-07-19 Joel Sherrill PR 1838/filesystem * psxfchx01/init.c, psxfchx01/psxfchx01.scn: fchmod() does not need a writeable file descriptor. --- testsuites/psxtests/psxfchx01/init.c | 17 ++++++++--------- testsuites/psxtests/psxfchx01/psxfchx01.scn | 12 ++++++------ 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'testsuites/psxtests/psxfchx01') diff --git a/testsuites/psxtests/psxfchx01/init.c b/testsuites/psxtests/psxfchx01/init.c index 486837caac..09d24f6f20 100644 --- a/testsuites/psxtests/psxfchx01/init.c +++ b/testsuites/psxtests/psxfchx01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -55,7 +55,7 @@ rtems_task Init( rtems_test_assert( status == -1 ); rtems_test_assert( errno == EINVAL ); - puts(" Init - closing /newfile -- OK" ); + puts( "Init - closing /newfile -- OK" ); status = close( fd ); rtems_test_assert( status == 0 ); @@ -140,12 +140,11 @@ rtems_task Init( fd = open( "/newfile", O_RDONLY | O_CREAT, S_IRWXU ); rtems_test_assert( fd != -1 ); - puts( "Init - fchmod, with the opened file descriptor - expect EINVAL" ); + puts( "Init - fchmod, with the opened file descriptor -- OK" ); status = fchmod( fd, 0 ); - rtems_test_assert( status == -1 ); - rtems_test_assert( errno == EINVAL ); + rtems_test_assert( status == 0 ); - puts(" Init - close and remove /newfile" ); + puts( "Init - close and remove /newfile" ); status = close( fd ); status |= unlink( "/newfile" ); rtems_test_assert( status == 0 ); @@ -158,7 +157,7 @@ rtems_task Init( status = fchmod( fd, S_IRUSR ); rtems_test_assert( status == 0 ); - puts(" Init - close and remove /newfile -- OK" ); + puts( "Init - close and remove /newfile -- OK" ); status = close( fd ); status |= unlink( "/newfile" ); rtems_test_assert( status == 0 ); @@ -190,7 +189,7 @@ rtems_task Init( rtems_test_assert( status == -1 ); rtems_test_assert( errno == EINVAL ); - puts(" Init - close and remove /newfile" ); + puts( "Init - close and remove /newfile" ); status = close( fd ); status |= unlink( "/newfile" ); rtems_test_assert( status == 0 ); @@ -203,7 +202,7 @@ rtems_task Init( status = fchown( fd, 1, 0 ); rtems_test_assert( status == 0 ); - puts(" Init - close and remove /newfile -- OK" ); + puts( "Init - close and remove /newfile -- OK" ); status = close( fd ); status |= unlink( "/newfile" ); rtems_test_assert( status == 0 ); diff --git a/testsuites/psxtests/psxfchx01/psxfchx01.scn b/testsuites/psxtests/psxfchx01/psxfchx01.scn index 85f3ce8683..d1ed655061 100644 --- a/testsuites/psxtests/psxfchx01/psxfchx01.scn +++ b/testsuites/psxtests/psxfchx01/psxfchx01.scn @@ -4,7 +4,7 @@ Init - Attempt fchdir with bad file descriptor - expect EBADF Init - Attempt fchdir with bad file descriptor - expect EBADF Init - opening /newfile in write-mode -- OK Init - fchdir on the file descriptor - expect EINVAL - Init - closing /newfile -- OK +Init - closing /newfile -- OK Init - removing /newfile -- OK Init - opening /newfile in read-mode -- OK Init - fchdir on the file descriptor - expect ENOTDIR @@ -25,11 +25,11 @@ Init - fchmod tests Init - fchmod, with a bad file descriptor - expect EBADF Init - fchmod, with an unopened file descriptor - expect EBADF Init - open new file: /newfile in read-only mode -- OK -Init - fchmod, with the opened file descriptor - expect EINVAL - Init - close and remove /newfile +Init - fchmod, with the opened file descriptor -- OK +Init - close and remove /newfile Init - open new file: /newfile in read-write mode -- OK Init - fchmod, with the opened file descriptor -- OK - Init - close and remove /newfile -- OK +Init - close and remove /newfile -- OK End of fchmod tests Init - fchown tests @@ -37,9 +37,9 @@ Init - fchown, with a bad file descriptor - expect EBADF Init - fchown, with an unopened file descriptor - expect EBADF Init - open new file: /newfile in read-only mode -- OK Init - fchown, with the opened file descriptor - expect EINVAL - Init - close and remove /newfile +Init - close and remove /newfile Init - open new file: /newfile in read-write mode -- OK Init - fchown, with the opened file descriptor -- OK - Init - close and remove /newfile -- OK +Init - close and remove /newfile -- OK End of fchown tests *** END OF TEST Posix file op tests - 01 *** -- cgit v1.2.3