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
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-01-20 00:30:34 +0300
committerJeff Johnston <jjohnstn@redhat.com>2004-01-20 00:30:34 +0300
commit403f752cb26c161ca80bdab4981640316f67ed39 (patch)
tree5335093d25bf26b49554450e3e686db150664e34 /newlib
parent14aecf24eb84343582bb4fe42b20b32f63c7edaa (diff)
2004-01-19 Thomas Pfaff <tpfaff@gmx.net>
* libc/stdio/fclose.c (fclose): Release FILE as the last step. * libc/stdio/freopen.c (freopen): Ditto.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/stdio/fclose.c2
-rw-r--r--newlib/libc/stdio/freopen.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 5e57a37a8..1641d7b87 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-19 Thomas Pfaff <tpfaff@gmx.net>
+
+ * libc/stdio/fclose.c (fclose): Release FILE as the last step.
+ * libc/stdio/freopen.c (freopen): Ditto.
+
2004-01-16 Christopher Faylor <cgf@redhat.com>
* libc/stdio/vfprintf.c: Add sys/lock.h include.
diff --git a/newlib/libc/stdio/fclose.c b/newlib/libc/stdio/fclose.c
index 630cd4192..1caeb4cde 100644
--- a/newlib/libc/stdio/fclose.c
+++ b/newlib/libc/stdio/fclose.c
@@ -83,11 +83,11 @@ _DEFUN (fclose, (fp),
FREEUB (fp);
if (HASLB (fp))
FREELB (fp);
- fp->_flags = 0; /* release this FILE for reuse */
_funlockfile(fp);
#ifndef __SINGLE_THREAD__
__lock_close_recursive (*(_LOCK_RECURSIVE_T *)&fp->_lock);
#endif
+ fp->_flags = 0; /* release this FILE for reuse */
return (r);
}
diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c
index 6d54789da..ba83dd215 100644
--- a/newlib/libc/stdio/freopen.c
+++ b/newlib/libc/stdio/freopen.c
@@ -148,12 +148,12 @@ _DEFUN (_freopen_r, (ptr, file, mode, fp),
if (f < 0)
{ /* did not get it after all */
- fp->_flags = 0; /* set it free */
ptr->_errno = e; /* restore in case _close clobbered */
_funlockfile(fp);
#ifndef __SINGLE_THREAD__
__lock_close_recursive (*(_LOCK_RECURSIVE_T *)&fp->_lock);
#endif
+ fp->_flags = 0; /* set it free */
return NULL;
}