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/stdio64/fopen64.c')
-rw-r--r--newlib/libc/stdio64/fopen64.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/newlib/libc/stdio64/fopen64.c b/newlib/libc/stdio64/fopen64.c
index 61c4e4f45..3c69820ee 100644
--- a/newlib/libc/stdio64/fopen64.c
+++ b/newlib/libc/stdio64/fopen64.c
@@ -91,17 +91,10 @@ _DEFUN (_fopen64_r, (ptr, file, mode),
if ((f = _open64_r (ptr, file, oflags, 0666)) < 0)
{
- __sfp_lock_acquire ();
fp->_flags = 0; /* release */
-#ifndef __SINGLE_THREAD__
- __lock_close_recursive (fp->_lock);
-#endif
- __sfp_lock_release ();
return NULL;
}
- _flockfile(fp);
-
fp->_file = f;
fp->_flags = flags;
fp->_cookie = (_PTR) fp;
@@ -121,7 +114,10 @@ _DEFUN (_fopen64_r, (ptr, file, mode),
fp->_flags |= __SL64;
- _funlockfile(fp);
+#ifndef __SINGLE_THREAD__
+ __lock_init_recursive (*(_LOCK_RECURSIVE_T *)&fp->_lock);
+#endif
+
return fp;
}