Problem in _rename_r function wrt errno in a particular case

Bharath Suri bharath.s.jois at gmail.com
Wed May 12 10:44:14 UTC 2010


Hi,

In a particular case, where the new_path is not a valid entry, the
application would get the result of the operation as -1 (OK), but also
the errno as -1 (NOK).
What I could figure out is when the call
result = (*new_parent_loc.ops->evalformake_h)( &new[i],
&new_parent_loc, &name );
is made, the errno (ENOENT, in my case) is set by the called function
(In my case, it was IMFS_evaluate_for_make) and return -1 which is the
value of result in _rename_r function.

The problem is that consequently _rename_r calls the
rtems_set_errno_and_return_minus_one( result );
which sets the errno to -1 and the actual errno is lost for the application.

In my opinion, the function _rename_r should only return -1, and not
alter the errno set by the evalformake_h function in this case.

/Bharath



More information about the users mailing list