#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 08/31/10 at 13:39:37 by Gedare Bloom

Cc: giddyup44@… added

comment:2 Changed on 09/02/10 at 19:51:24 by Joel Sherrill

Cc: Joel Sherrill added

comment:3 Changed on 09/02/10 at 22:14:28 by Chris Johns

Status: newassigned

comment:4 Changed on 09/06/10 at 04:57:25 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 11/24/14 at 18:58:28 by Gedare Bloom

Version: HEAD4.11

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

comment:6 Changed on 02/23/15 at 19:46:01 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.