rewinddir() doesn't work properly with readdir_r
|Reported by:||saprykin||Owned by:||nobody|
|Keywords:||rewinddir readdir_r dirent||Cc:|
|Has a Patch:||no||Platform:||All|
I have noticed a wrong behavior of rewinddir():
- open a directory with opendir() and read to the end using readdir_r();
- call rewinddir();
- try to read the next entry with readdir_r().
I was expecting to get the first directory entry, instead of that I'm getting NULL which means the end of a directory stream.