summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-05 16:34:20 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-05 16:34:20 +0000
commit0139484fbdc976ffe07598d1284aad5eba3219be (patch)
tree3632f5cded6a44289b0783ad7d1fe4c617a11037 /c
parentRemoved targets and configurations that are no longer functional (diff)
downloadrtems-0139484fbdc976ffe07598d1284aad5eba3219be.tar.bz2
Patch from Wayne Bullaughey <wayne@wmi.com>. 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.
Diffstat (limited to 'c')
-rw-r--r--c/src/exec/libcsupport/src/eval.c2
-rw-r--r--c/src/lib/libc/eval.c2
2 files changed, 2 insertions, 2 deletions
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 );