1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Don't touch user-controlled stdio locks in forked child (bug 12847)

The stdio locks for streams with the _IO_USER_LOCK flag should not be
touched by internal code.
This commit is contained in:
Andreas Schwab
2014-12-08 15:13:38 +01:00
parent aa76a5c701
commit 217a74a85c
2 changed files with 8 additions and 1 deletions

View File

@ -46,7 +46,8 @@ fresetlockfiles (void)
_IO_ITER i;
for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
_IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
if ((_IO_iter_file (i)->_flags & _IO_USER_LOCK) == 0)
_IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
}