Fix __fp_lock_all() and __fp_unlock_all()
For _REENT_GLOBAL_STDIO_STREAMS, lock/unlock all FILE objects. In the repository, this function is only used by Cygwin during process forks. Since Cygwin enabled _REENT_GLOBAL_STDIO_STREAMS recently, without this fix no FILE object at all was locked.
This commit is contained in:
parent
aa460cc0ca
commit
c4d4439c42
|
@ -329,6 +329,8 @@ __fp_lock_all (void)
|
||||||
#ifndef _REENT_GLOBAL_STDIO_STREAMS
|
#ifndef _REENT_GLOBAL_STDIO_STREAMS
|
||||||
ptr = _REENT;
|
ptr = _REENT;
|
||||||
(void) _fwalk_sglue (ptr, __fp_lock, &ptr->__sglue);
|
(void) _fwalk_sglue (ptr, __fp_lock, &ptr->__sglue);
|
||||||
|
#else
|
||||||
|
(void) _fwalk_sglue (NULL, __fp_lock, &__sglue);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,6 +342,8 @@ __fp_unlock_all (void)
|
||||||
|
|
||||||
ptr = _REENT;
|
ptr = _REENT;
|
||||||
(void) _fwalk_sglue (ptr, __fp_unlock, &ptr->__sglue);
|
(void) _fwalk_sglue (ptr, __fp_unlock, &ptr->__sglue);
|
||||||
|
#else
|
||||||
|
(void) _fwalk_sglue (NULL, __fp_unlock, &__sglue);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__sfp_lock_release ();
|
__sfp_lock_release ();
|
||||||
|
|
Loading…
Reference in New Issue