diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-26 19:57:19 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-26 19:57:19 +0000 |
commit | 030ab087ef643174b48931bae92bad1f7af4a39c (patch) | |
tree | e9f78383e4b166b6aa9468baa003cf0d8a256a91 /cpukit/libcsupport/src/eval.c | |
parent | 2010-08-26 Bharath Suri <bharath.s.jois@gmail.com> (diff) | |
download | rtems-030ab087ef643174b48931bae92bad1f7af4a39c.tar.bz2 |
2010-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/eval.c: Make some filesystem implementation
correctness checks conditional on RTEMS_DEBUG.
Diffstat (limited to 'cpukit/libcsupport/src/eval.c')
-rw-r--r-- | cpukit/libcsupport/src/eval.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/cpukit/libcsupport/src/eval.c b/cpukit/libcsupport/src/eval.c index 9ef8c735a5..5a9118d3e1 100644 --- a/cpukit/libcsupport/src/eval.c +++ b/cpukit/libcsupport/src/eval.c @@ -3,7 +3,7 @@ * * Routine to seed the evaluate path routine. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -32,15 +32,17 @@ int rtems_filesystem_evaluate_relative_path( int result; rtems_filesystem_node_types_t type; - /* - * Verify Input parameters. - */ + #if defined(RTEMS_DEBUG) + /* + * Verify Input parameters that should never be bad unless someone + * is implementing a new filesystem and has bugs. + */ + if ( !pathname ) + rtems_set_errno_and_return_minus_one( EFAULT ); - if ( !pathname ) - rtems_set_errno_and_return_minus_one( EFAULT ); - - if ( !pathloc ) - rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ + if ( !pathloc ) + rtems_set_errno_and_return_minus_one( EIO ); + #endif result = (*pathloc->ops->evalpath_h)( pathname, pathnamelen, flags, pathloc ); @@ -87,15 +89,17 @@ int rtems_filesystem_evaluate_path( { int i = 0; - /* - * Verify Input parameters. - */ - - if ( !pathname ) - rtems_set_errno_and_return_minus_one( EFAULT ); - - if ( !pathloc ) - rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ + #if defined(RTEMS_DEBUG) + /* + * Verify Input parameters that should never be bad unless someone + * is implementing a new filesystem and has bugs. + */ + if ( !pathname ) + rtems_set_errno_and_return_minus_one( EFAULT ); + + if ( !pathloc ) + rtems_set_errno_and_return_minus_one( EIO ); + #endif /* * Evaluate the path using the optable evalpath. |