From 030ab087ef643174b48931bae92bad1f7af4a39c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 26 Aug 2010 19:57:19 +0000 Subject: 2010-08-26 Joel Sherrill * libcsupport/src/eval.c: Make some filesystem implementation correctness checks conditional on RTEMS_DEBUG. --- cpukit/libcsupport/src/eval.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'cpukit/libcsupport') 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. -- cgit v1.2.3