Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-07-17 Thread James Youngman
I'm a bit late coming to this thread, sorry. The "oldfind" (i.e. not-fts) implementation of find iterates over a directory like this: while (1) { const char *namep; const struct dirent *dp; /* We reset errno here to distinguish between end-of-director

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-07-06 Thread Pádraig Brady
On 23/06/16 08:04, Bernhard Voelker wrote: > BTW: > gnulib's FTS was copied from coreutils which in turn comes from glibc > which still looks quite similiar: > https://sourceware.org/git/?p=glibc.git;a=history;f=io/fts.c > They also still don't catch readdir() errors there, so shouldn't we inform

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-23 Thread Bernhard Voelker
On 06/23/2016 01:38 AM, Pádraig Brady wrote: > On 22/06/16 23:53, Bernhard Voelker wrote: >> On 06/22/2016 03:01 PM, Pádraig Brady wrote: >>> It'll need this on top, to better differentiate FTS_ERR and FTS_DNR, >>> as fts_build may be called multiple times for the same dir. >> >> Hmm, but rm(1) won

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Pádraig Brady
On 22/06/16 23:53, Bernhard Voelker wrote: > On 06/22/2016 03:01 PM, Pádraig Brady wrote: >> It'll need this on top, to better differentiate FTS_ERR and FTS_DNR, >> as fts_build may be called multiple times for the same dir. > > Hmm, but rm(1) won't show the errno. Right, as FTS_DNR is actually p

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Bernhard Voelker
On 06/22/2016 03:01 PM, Pádraig Brady wrote: > It'll need this on top, to better differentiate FTS_ERR and FTS_DNR, > as fts_build may be called multiple times for the same dir. Hmm, but rm(1) won't show the errno. I'm getting better results with the attached, i.e., handling the readdir() failure

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread P. Benie
On Wed, 22 Jun 2016, Bernhard Voelker wrote: On 06/22/2016 02:48 PM, Pádraig Brady wrote: On 22/06/16 13:18, Bernhard Voelker wrote: Unfortunately, it seems we don't have test for fts.c, do we? Not that I know of. For effective testing of this you'd have to use something like cmocka, or more

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Pádraig Brady
On 22/06/16 14:47, P. Benie wrote: > On Wed, 22 Jun 2016, Bernhard Voelker wrote: > >> On 06/22/2016 02:48 PM, Pádraig Brady wrote: >>> On 22/06/16 13:18, Bernhard Voelker wrote: Unfortunately, it seems we don't have test for fts.c, do we? >>> >>> Not that I know of. >>> For effective testing

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Pádraig Brady
On 22/06/16 12:00, Pádraig Brady wrote: > On 21/06/16 19:58, Bernhard Voelker wrote: >> forwarding to gnulib. >> >> Have a nice day, >> Berny >> >> >> Forwarded Message -------- >> Subject: [Bug 984910] rm fails to detect errors in r

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Bernhard Voelker
On 06/22/2016 02:48 PM, Pádraig Brady wrote: > On 22/06/16 13:18, Bernhard Voelker wrote: >> Unfortunately, it seems we don't have test for fts.c, do we? > > Not that I know of. > For effective testing of this you'd have to use something like cmocka, > or more generically something like CharybdeFS

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Pádraig Brady
On 22/06/16 13:18, Bernhard Voelker wrote: > On 06/22/2016 01:00 PM, Pádraig Brady wrote: >> How about the attached instead? > > That's a sensible solution. > >> diff --git a/lib/fts.c b/lib/fts.c >> index bcdcff9..d022633 100644 >> --- a/lib/fts.c >> +++ b/lib/fts.c >> @@ -1461,9 +1461,15 @@ fts

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Bernhard Voelker
On 06/22/2016 01:00 PM, Pádraig Brady wrote: > How about the attached instead? That's a sensible solution. > diff --git a/lib/fts.c b/lib/fts.c > index bcdcff9..d022633 100644 > --- a/lib/fts.c > +++ b/lib/fts.c > @@ -1461,9 +1461,15 @@ fts_build (register FTS *sp, int type) > while (cur

Re: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-22 Thread Pádraig Brady
On 21/06/16 19:58, Bernhard Voelker wrote: > forwarding to gnulib. > > Have a nice day, > Berny > > > Forwarded Message ---- > Subject: [Bug 984910] rm fails to detect errors in readdir(3) > Date: Wed, 15 Jun 2016 19:26:24 + &g

Fwd: [Bug 984910] rm fails to detect errors in readdir(3)

2016-06-21 Thread Bernhard Voelker
forwarding to gnulib. Have a nice day, Berny Forwarded Message Subject:[Bug 984910] rm fails to detect errors in readdir(3) Date: Wed, 15 Jun 2016 19:26:24 + From: bugzilla_nore...@novell.com Andreas Stieger changed bug 984910 <http://bugzilla.opensuse.