Ingo Schwarze wrote on Mon, Nov 04, 2013 at 09:51:41AM +0100:

> I will send a minimal one-line patch to just fix the bug
> and do nothing else.  We should get that one in quickly.
> That would also be a candidate for -stable, i think.
> I hope to come round to that tonight.

Here it is.

This fixes both our own regression tests (Ottos and mine)
and the perl-5.18 op/threads-dirh.t test.

This is not particularly efficient, forcing getdents(2) for each
readdir(3) following seekdir(3), but at least it produces correct
results, for a start.

OK?
  Ingo


Index: telldir.c
===================================================================
RCS file: /cvs/src/lib/libc/gen/telldir.c,v
retrieving revision 1.15
diff -u -p -r1.15 telldir.c
--- telldir.c   16 Aug 2013 05:27:39 -0000      1.15
+++ telldir.c   4 Nov 2013 21:11:55 -0000
@@ -67,5 +67,6 @@ telldir(DIR *dirp)
 void
 __seekdir(DIR *dirp, long loc)
 {
+       dirp->dd_loc = 0;
        dirp->dd_curpos = lseek(dirp->dd_fd, loc, SEEK_SET);
 }

Reply via email to