? 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
|
|
|
1 | 1 | /* |
2 | 2 | * fchmod() - POSIX 1003.1b 5.6.4 - Change File Modes |
3 | 3 | * |
4 | | * COPYRIGHT (c) 1989-1999. |
| 4 | * COPYRIGHT (c) 1989-2011. |
5 | 5 | * On-Line Applications Research Corporation (OAR). |
6 | 6 | * |
7 | 7 | * The license and distribution terms for this file may be |
… |
… |
|
38 | 38 | /* |
39 | 39 | * Now process the fchmod(). |
40 | 40 | */ |
41 | | |
42 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); |
43 | | |
44 | 41 | return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode ); |
45 | 42 | } |
RCS file: /usr1/CVS/rtems/testsuites/psxtests/psxfchx01/init.c,v
retrieving revision 1.2
diff -u -r1.2 init.c
|
|
|
1 | 1 | /* |
2 | | * COPYRIGHT (c) 1989-2010. |
| 2 | * COPYRIGHT (c) 1989-2011. |
3 | 3 | * On-Line Applications Research Corporation (OAR). |
4 | 4 | * |
5 | 5 | * The license and distribution terms for this file may be |
… |
… |
|
55 | 55 | rtems_test_assert( status == -1 ); |
56 | 56 | rtems_test_assert( errno == EINVAL ); |
57 | 57 | |
58 | | puts(" Init - closing /newfile -- OK" ); |
| 58 | puts( "Init - closing /newfile -- OK" ); |
59 | 59 | status = close( fd ); |
60 | 60 | rtems_test_assert( status == 0 ); |
61 | 61 | |
… |
… |
|
140 | 140 | fd = open( "/newfile", O_RDONLY | O_CREAT, S_IRWXU ); |
141 | 141 | rtems_test_assert( fd != -1 ); |
142 | 142 | |
143 | | puts( "Init - fchmod, with the opened file descriptor - expect EINVAL" ); |
| 143 | puts( "Init - fchmod, with the opened file descriptor -- OK" ); |
144 | 144 | status = fchmod( fd, 0 ); |
145 | | rtems_test_assert( status == -1 ); |
146 | | rtems_test_assert( errno == EINVAL ); |
| 145 | rtems_test_assert( status == 0 ); |
147 | 146 | |
148 | | puts(" Init - close and remove /newfile" ); |
| 147 | puts( "Init - close and remove /newfile" ); |
149 | 148 | status = close( fd ); |
150 | 149 | status |= unlink( "/newfile" ); |
151 | 150 | rtems_test_assert( status == 0 ); |
… |
… |
|
158 | 157 | status = fchmod( fd, S_IRUSR ); |
159 | 158 | rtems_test_assert( status == 0 ); |
160 | 159 | |
161 | | puts(" Init - close and remove /newfile -- OK" ); |
| 160 | puts( "Init - close and remove /newfile -- OK" ); |
162 | 161 | status = close( fd ); |
163 | 162 | status |= unlink( "/newfile" ); |
164 | 163 | rtems_test_assert( status == 0 ); |
… |
… |
|
190 | 189 | rtems_test_assert( status == -1 ); |
191 | 190 | rtems_test_assert( errno == EINVAL ); |
192 | 191 | |
193 | | puts(" Init - close and remove /newfile" ); |
| 192 | puts( "Init - close and remove /newfile" ); |
194 | 193 | status = close( fd ); |
195 | 194 | status |= unlink( "/newfile" ); |
196 | 195 | rtems_test_assert( status == 0 ); |
… |
… |
|
203 | 202 | status = fchown( fd, 1, 0 ); |
204 | 203 | rtems_test_assert( status == 0 ); |
205 | 204 | |
206 | | puts(" Init - close and remove /newfile -- OK" ); |
| 205 | puts( "Init - close and remove /newfile -- OK" ); |
207 | 206 | status = close( fd ); |
208 | 207 | status |= unlink( "/newfile" ); |
209 | 208 | rtems_test_assert( status == 0 ); |
RCS file: /usr1/CVS/rtems/testsuites/psxtests/psxfchx01/psxfchx01.scn,v
retrieving revision 1.1
diff -u -r1.1 psxfchx01.scn
|
|
|
4 | 4 | Init - Attempt fchdir with bad file descriptor - expect EBADF |
5 | 5 | Init - opening /newfile in write-mode -- OK |
6 | 6 | Init - fchdir on the file descriptor - expect EINVAL |
7 | | Init - closing /newfile -- OK |
| 7 | Init - closing /newfile -- OK |
8 | 8 | Init - removing /newfile -- OK |
9 | 9 | Init - opening /newfile in read-mode -- OK |
10 | 10 | Init - fchdir on the file descriptor - expect ENOTDIR |
… |
… |
|
25 | 25 | Init - fchmod, with a bad file descriptor - expect EBADF |
26 | 26 | Init - fchmod, with an unopened file descriptor - expect EBADF |
27 | 27 | Init - 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 |
| 28 | Init - fchmod, with the opened file descriptor -- OK |
| 29 | Init - close and remove /newfile |
30 | 30 | Init - open new file: /newfile in read-write mode -- OK |
31 | 31 | Init - fchmod, with the opened file descriptor -- OK |
32 | | Init - close and remove /newfile -- OK |
| 32 | Init - close and remove /newfile -- OK |
33 | 33 | End of fchmod tests |
34 | 34 | |
35 | 35 | Init - fchown tests |
… |
… |
|
37 | 37 | Init - fchown, with an unopened file descriptor - expect EBADF |
38 | 38 | Init - open new file: /newfile in read-only mode -- OK |
39 | 39 | Init - fchown, with the opened file descriptor - expect EINVAL |
40 | | Init - close and remove /newfile |
| 40 | Init - close and remove /newfile |
41 | 41 | Init - open new file: /newfile in read-write mode -- OK |
42 | 42 | Init - fchown, with the opened file descriptor -- OK |
43 | | Init - close and remove /newfile -- OK |
| 43 | Init - close and remove /newfile -- OK |
44 | 44 | End of fchown tests |
45 | 45 | *** END OF TEST Posix file op tests - 01 *** |