[Bug 1695] bytes_transfered = rtems_rfs_rtems_error

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Aug 31 01:47:17 CDT 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1695

--- Comment #3 from Chris Johns <chrisj at rtems.org> 2010-08-31 01:47:16 CDT ---
> (In reply to comment #1)
> > I do not see a problem with this code as 'rtems_rfs_rtems_error' returns 0 or
> > -1 depending on the value of 'rc' which in this case is != 0 so
> > bytes_transfered is always set to -1.
> 
> Well, this code might work, however I consider this code to be dirty.

Could you please elaborate ?

The code in question is:

#define rtems_rfs_rtems_error(_m, _e) \
  (((errno = (_e)) == 0) ? 0 : -1)

so:

 bytes_transfered = (((errno = (rc)) ? 0 : -1);
 break;

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the rtems-bugs mailing list