Ticket #63: chdir.diff

File chdir.diff, 1.5 KB (added by Joel Sherrill, on 12/03/06 at 13:31:12)

chdir.diff

Line 
1Index: c/src/lib/libc/chdir.c
2===================================================================
3RCS file: /usr1/CVS/rtems/c/src/lib/libc/chdir.c,v
4retrieving revision 1.7
5diff -c -r1.7 chdir.c
6*** c/src/lib/libc/chdir.c      2001/01/08 18:26:44     1.7
7--- c/src/lib/libc/chdir.c      2001/11/07 23:15:27
8***************
9*** 33,39 ****
10     *  Get the node where we wish to go.
11     */
12 
13!   result = rtems_filesystem_evaluate_path( pathname, 0, &loc, TRUE );
14    if ( result != 0 )
15       return -1;
16 
17--- 33,40 ----
18     *  Get the node where we wish to go.
19     */
20 
21!   result = rtems_filesystem_evaluate_path(
22!     pathname, RTEMS_LIBIO_PERMS_SEARCH, &loc, TRUE );
23    if ( result != 0 )
24       return -1;
25 
26Index: c/src/tests/psxtests/psxstat/test.c
27===================================================================
28RCS file: /usr1/CVS/rtems/c/src/tests/psxtests/psxstat/test.c,v
29retrieving revision 1.10
30diff -c -r1.10 test.c
31*** c/src/tests/psxtests/psxstat/test.c 2001/04/20 13:50:54     1.10
32--- c/src/tests/psxtests/psxstat/test.c 2001/11/07 23:15:53
33***************
34*** 483,490 ****
35    assert( errno == EPERM );
36 
37    /*
38!    * Try to chdir to a file.
39     */
40 
41    printf("chdir to a file should fail with ENOTDIR\n");
42    status = chdir( Files[0] );
43--- 483,493 ----
44    assert( errno == EPERM );
45 
46    /*
47!    * Change file to executable then try to chdir to it.
48     */
49+
50+   status = chmod( Files[0], S_IXUSR );
51+   assert( status != -1 );
52 
53    printf("chdir to a file should fail with ENOTDIR\n");
54    status = chdir( Files[0] );