diff options
Diffstat (limited to 'newlib/libc/stdio/freopen.c')
-rw-r--r-- | newlib/libc/stdio/freopen.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index ae774c65b..172006259 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -98,8 +98,6 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), int flags, oflags; int e = 0; - __sfp_lock_acquire (); - CHECK_INIT (ptr, fp); _flockfile (fp); @@ -108,7 +106,6 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), { _funlockfile (fp); _fclose_r (ptr, fp); - __sfp_lock_release (); return NULL; } @@ -208,6 +205,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), if (f < 0) { /* did not get it after all */ + __sfp_lock_acquire (); fp->_flags = 0; /* set it free */ ptr->_errno = e; /* restore in case _close clobbered */ _funlockfile (fp); @@ -232,7 +230,6 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), #endif _funlockfile (fp); - __sfp_lock_release (); return fp; } |