[Bug 1695] bytes_transfered = rtems_rfs_rtems_error

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Aug 31 14:39:37 UTC 2010


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

Gedare <giddyup44 at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giddyup44 at yahoo.com

--- Comment #4 from Gedare <giddyup44 at yahoo.com> 2010-08-31 09:39:37 CDT ---
(In reply to comment #3)
> > (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;

The question at hand is whether it makes sense to say bytes transferred is
always either 0 or -1.  This implies there really is no data transfer ever. So
the variable name bytes_transfered is a bite of a misnomer (and a misspelling,
there should be two r's).

-- 
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 bugs mailing list