BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001012 [uClibc] Other major always 08-30-06 07:27 09-15-07 02:24
Reporter moschny View Status public  
Assigned To uClibc
Priority normal Resolution fixed  
Status closed   Product Version 0.9.28
Summary 0001012: readdir_r returns previous errno
Description When errno is set to a value!=0, readdir_r() will return the value of errno as the error value after reading all directory entries.

The relevant code part is this (libc/misc/dirent/readdir_r.c):

                //...
        bytes = __getdents(dir->dd_fd, dir->dd_buf, dir->dd_max);
        if (bytes <= 0) {
            *result = NULL;
            ret = errno;
            goto all_done;
        }
                // ...

If bytes==0, ret should be set to zero and not the (old, and unchanged by __getdents) errno value. If bytes<0, errno as set by __getdents can be returned.
Additional Information
Attached Files  100-readdir_r.patch [^] (802 bytes) 08-30-06 13:51

- Relationships

- Notes
(0001599)
moschny
08-30-06 13:52

This is a quick and dirty patch to get things working for me. Maybe there are cleaner solutions.
 
(0002750)
vapier
09-15-07 02:24

should be fixed in current trunk now, thanks for the patch
 

- Issue History
Date Modified Username Field Change
08-30-06 07:27 moschny New Issue
08-30-06 07:27 moschny Status new => assigned
08-30-06 07:27 moschny Assigned To  => uClibc
08-30-06 13:51 moschny File Added: 100-readdir_r.patch
08-30-06 13:52 moschny Note Added: 0001599
09-15-07 02:24 vapier Note Added: 0002750
09-15-07 02:24 vapier Status assigned => closed
09-15-07 02:24 vapier Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker