From 91a8eacec6575a3a2c6aa4c4cf26961870f6074a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 8 Dec 2015 21:23:22 +0100 Subject: Add missing checks for __SNLK flag * libc/stdio/fclose.c (_fclose_r): Make _flockfile/_funlockfile calls dependent on __SNLK flag. * libc/stdio/findfp.c (__fp_lock): Ditto. (__fp_unlock): Ditto. * libc/stdio/freopen.c (_freopen_r): Ditto. * libc/stdio64/freopen64.c (_freopen64_r): Ditto. Signed-off-by: Corinna Vinschen --- newlib/libc/stdio/findfp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'newlib/libc/stdio/findfp.c') diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index 27408f548..975a855c2 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -293,7 +293,8 @@ static int _DEFUN(__fp_lock, (ptr), FILE * ptr) { - _flockfile (ptr); + if (!(ptr->_flags2 & __SNLK)) + _flockfile (ptr); return 0; } @@ -303,7 +304,8 @@ static int _DEFUN(__fp_unlock, (ptr), FILE * ptr) { - _funlockfile (ptr); + if (!(ptr->_flags2 & __SNLK)) + _funlockfile (ptr); return 0; } -- cgit v1.2.3