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
This commit is contained in:
John Baldwin 2014-07-24 20:44:30 +00:00
parent 5f48d8fc26
commit 0708297e43

View File

@ -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);
}