jhb cabf1ab5da MFC 268531,269079,269204:
Fix various edge cases with rewinddir(), seekdir(), and telldir():
- In the unionfs case, opendir() and fdopendir() read the directory's full
  contents and cache it.  This cache is not refreshed when rewinddir() is
  called, so rewinddir() will not notice updates to a directory.  Fix this
  by splitting the code to fetch a directory's contents out of
  __opendir_common() into a new _filldir() function and call this from
  rewinddir() when operating on a unionfs directory.
- If rewinddir() is called on a directory opened with fdopendir() before
  any directory entries are fetched, rewinddir() will not adjust the seek
  location of the backing file descriptor.  If the file descriptor passed
  to fdopendir() had a non-zero offset, the rewinddir() will not rewind to
  the beginning.  Fix this by always seeking back to 0 in rewinddir().
  This means the dd_rewind hack can also be removed.
- Add missing locking to rewinddir()
- 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.
- If telldir() is called immediately after a call to seekdir(), POSIX
  requires the return value of telldir() to equal the value passed to
  seekdir().  The current seekdir code with SINGLEUSE enabled breaks
  this case as each call to telldir() allocates a new cookie.  Instead,
  remove the SINGLEUSE code and change telldir() to look for an existing
  cookie for the directory's current location rather than always creating
  a new cookie.

PR:		121656
2014-08-14 20:20:21 +00:00
..
2014-08-04 14:56:49 +00:00
2013-01-01 18:29:25 +00:00
2014-08-14 20:20:21 +00:00
2013-11-29 19:44:30 +00:00
2014-03-05 19:30:36 +00:00
2013-12-10 22:55:22 +00:00
2014-02-09 00:34:21 +00:00
2014-07-26 02:41:18 +00:00
2012-06-02 08:47:26 +00:00
2014-01-09 23:08:56 +00:00
2014-06-20 07:32:03 +00:00
2014-04-24 10:23:35 +00:00
2012-04-18 07:02:53 +00:00
2014-07-11 00:00:00 +00:00
2014-03-31 00:28:54 +00:00
2013-09-08 10:04:26 +00:00
2013-05-30 08:02:00 +00:00
2014-06-18 05:35:09 +00:00
2014-08-12 17:56:48 +00:00
2014-03-19 23:55:03 +00:00
2013-05-12 22:22:12 +00:00
2014-08-08 14:53:01 +00:00
2014-02-01 22:29:04 +00:00
2013-11-14 09:25:29 +00:00
2014-07-25 23:12:22 +00:00
2012-10-18 15:39:29 +00:00
2013-05-12 22:22:12 +00:00
2014-06-07 02:45:24 +00:00
2014-07-19 23:44:57 +00:00
2014-06-13 07:33:43 +00:00
2014-07-29 22:29:31 +00:00
2013-10-23 18:07:07 +00:00
2014-07-20 00:32:22 +00:00
2014-03-01 03:09:16 +00:00
2013-12-28 20:05:31 +00:00
2014-04-09 18:16:58 +00:00