Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fileno.c')
-rw-r--r--newlib/libc/stdio/fileno.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/newlib/libc/stdio/fileno.c b/newlib/libc/stdio/fileno.c
index d578c3ede..c9ecbb424 100644
--- a/newlib/libc/stdio/fileno.c
+++ b/newlib/libc/stdio/fileno.c
@@ -35,6 +35,10 @@ int
_DEFUN (fileno, (f),
FILE * f)
{
+ int result;
+ _flockfile(f);
CHECK_INIT (f);
- return __sfileno (f);
+ result = __sfileno (f);
+ _funlockfile(f);
+ return result;
}