mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
linux: Use internal DIR locks when accessing filepos on telldir
Since it might change during a readdir call. Checked on x86_64-linux-gnu and i686-linux-gnu.
This commit is contained in:
parent
415d0b0b3f
commit
ef3330fde4
@ -23,5 +23,11 @@
|
||||
long int
|
||||
telldir (DIR *dirp)
|
||||
{
|
||||
return dirp->filepos;
|
||||
long int ret;
|
||||
|
||||
__libc_lock_lock (dirp->lock);
|
||||
ret = dirp->filepos;
|
||||
__libc_lock_unlock (dirp->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user