if (__isthreaded)
_pthread_mutex_lock(&dirp->dd_lock);
- dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */
+ dirp->dd_flags &= ~(__DTF_SKIPREAD | __DTF_ATEND); /* current contents are invalid */
if (dirp->dd_flags & __DTF_READALL)
_filldir(dirp, false);
else {