From 0139484fbdc976ffe07598d1284aad5eba3219be Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 5 Oct 1999 16:34:20 +0000 Subject: Patch from Wayne Bullaughey . Comments follow: I'm working on code to mount my host based file system on the base file system (imfs) and have a suggestion for a change to eval.c in the c/src/lib/libc directory of the 8/20/1999 snapshot. The current version does not test the result value returned from the evalpath callback (line 47) in the case where follow_link is true. Attached is my suggested change. Without this test the node_type callback may be called after evalpath failed. node_type could set the type to some value other then RTEMS_FILESYSTEM_HARD_LINK or RTEMS_FILESYSTEM_SYM_LINK but it seems cleaner to add the check on result. --- c/src/exec/libcsupport/src/eval.c | 2 +- c/src/lib/libc/eval.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'c') diff --git a/c/src/exec/libcsupport/src/eval.c b/c/src/exec/libcsupport/src/eval.c index bf7dd1c126..db294fcf54 100644 --- a/c/src/exec/libcsupport/src/eval.c +++ b/c/src/exec/libcsupport/src/eval.c @@ -51,7 +51,7 @@ int rtems_filesystem_evaluate_path( * not. */ - if ( follow_link ) { + if ( (result == 0) && follow_link ) { if ( !pathloc->ops->node_type ) set_errno_and_return_minus_one( ENOTSUP ); diff --git a/c/src/lib/libc/eval.c b/c/src/lib/libc/eval.c index bf7dd1c126..db294fcf54 100644 --- a/c/src/lib/libc/eval.c +++ b/c/src/lib/libc/eval.c @@ -51,7 +51,7 @@ int rtems_filesystem_evaluate_path( * not. */ - if ( follow_link ) { + if ( (result == 0) && follow_link ) { if ( !pathloc->ops->node_type ) set_errno_and_return_minus_one( ENOTSUP ); -- cgit v1.2.3