On Saturday 19 April 2008 22:31, Joakim Tjernlund wrote: > > My concern is that you loop back to readdir on ANY error. > > I was bitten by this kind of code myself. > > I see, why didn't you say so earlier. Have you seen this > on /proc too?
No. I just want to be defensive. > > The problem is that some errors are fatal: if you redo > > the operation, it will simply fail again with same error. > > > > The best thing to do is to test for specific errno values > > which you *know* are not of this kind and will not lead > > to infinite looping. > > > > Do you remember what errno was returned when you saw > > this bug in action? > > No, didn't check as readdir only have one possibly errno > listed in the man page: EBADF > There isn't any other error to test for. You can change > it if you like to test for that errno if you think it is > relevant. Manpages are trumped by reality. I imagine if disk returns read errors, readdir may give you EIO, and you don't want to retry that. Etc... Not applicable to /proc filesystem, of course. I propose leaving it as-is for now (with retry on any error). Whoever (and if) will be bitten by infinite looping, will hopefully report the bug. -- vda _______________________________________________ busybox mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/busybox
