summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/findfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/findfp.c')
-rw-r--r--newlib/libc/stdio/findfp.c6
1 files changed, 4 insertions, 2 deletions
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;
}