svn commit: r269079 - head/lib/libc/gen
John Baldwin
jhb at FreeBSD.org
Thu Jul 24 20:44:31 UTC 2014
Author: jhb
Date: Thu Jul 24 20:44:30 2014
New Revision: 269079
URL: http://svnweb.freebsd.org/changeset/base/269079
Log:
POSIX says that passing a location returned by telldir() to seekdir()
after an intervening call to rewinddir() is undefined, so reclaim any
pending telldir() cookies in the directory when rewinddir() is called.
CR: D459
Reviewed by: jilles
MFC after: 1 week
Modified:
head/lib/libc/gen/rewinddir.c
Modified: head/lib/libc/gen/rewinddir.c
==============================================================================
--- head/lib/libc/gen/rewinddir.c Thu Jul 24 20:16:45 2014 (r269078)
+++ head/lib/libc/gen/rewinddir.c Thu Jul 24 20:44:30 2014 (r269079)
@@ -58,6 +58,7 @@ rewinddir(dirp)
dirp->dd_seek = 0;
}
dirp->dd_loc = 0;
+ _reclaim_telldir(dirp);
if (__isthreaded)
_pthread_mutex_unlock(&dirp->dd_lock);
}
More information about the svn-src-head
mailing list