#1695 closed defect (invalid)

bytes_transfered = rtems_rfs_rtems_error

Reported by: Ralf Corsepius Owned by: Chris Johns
Priority: normal Milestone: 4.11
Component: fs Version: 4.11
Severity: normal Keywords:
Cc: joel.sherrill@…, sebastian.huber@…, gedare@… Blocked By:
Blocking:

Description (last modified by Gedare Bloom)

Next to cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:145
you find this code:
..

if (rc > 0)
{

bytes_transfered = rtems_rfs_rtems_error ("dir_read: dir read", rc);
break;

}

..

The bytes_transfered = rtems_rfs_rtems_error (...) doesn't seem right to me:

  • rtems_rfs_rtems_error returns a boolean error.

=> I doubt adding such a boolean error to a size is right

Change History (6)

comment:1 Changed on Aug 31, 2010 at 1:39:37 PM by Gedare Bloom

Cc: giddyup44@… added

comment:2 Changed on Sep 2, 2010 at 7:51:24 PM by Joel Sherrill

Cc: Joel Sherrill added

comment:3 Changed on Sep 2, 2010 at 10:14:28 PM by Chris Johns

Status: newassigned

comment:4 Changed on Sep 6, 2010 at 4:57:25 AM by Sebastian Huber

Cc: Sebastian Huber added

Replying to comment:16:
[...]

This is a bug. I propose to:

...
int rc;
ssize_t bytes_transferred;
...
return (ssize_t) bytes_transferred;

In this case you can remove the cast.

readdir(2) is not relevant for us. We have to look at getdents() used by Newlib 'libc/posix/readdir.c' and 'libc/posix/readdir_r.c'.

comment:5 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

comment:6 Changed on Feb 23, 2015 at 7:46:01 PM by Gedare Bloom

Description: modified (diff)
Resolution: invalid
Status: assignedclosed

This is no bug. The return from rtems_rfs_rtems_error is -1 for an error code, which is fine to return as an ssize_t.

Note: See TracTickets for help on using tickets.