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.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/newlib/libc/stdio/fileno.c b/newlib/libc/stdio/fileno.c
index be8f3d66a..db399eb12 100644
--- a/newlib/libc/stdio/fileno.c
+++ b/newlib/libc/stdio/fileno.c
@@ -47,7 +47,6 @@ Supporting OS subroutines required: none.
#include <_ansi.h>
#include <stdio.h>
-#include <errno.h>
#include "local.h"
int
@@ -56,14 +55,8 @@ _DEFUN(fileno, (f),
{
int result;
CHECK_INIT (_REENT, f);
- _newlib_flockfile_start (f);
- if (f->_flags)
- result = __sfileno (f);
- else
- {
- result = -1;
- _REENT->_errno = EBADF;
- }
- _newlib_flockfile_end (f);
+ _flockfile (f);
+ result = __sfileno (f);
+ _funlockfile (f);
return result;
}