]> sourceware.org Git - newlib-cygwin.git/commitdiff
2004-01-19 Thomas Pfaff <tpfaff@gmx.net>
authorJeff Johnston <jjohnstn@redhat.com>
Mon, 19 Jan 2004 21:30:34 +0000 (21:30 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Mon, 19 Jan 2004 21:30:34 +0000 (21:30 +0000)
        * libc/stdio/fclose.c (fclose): Release FILE as the last step.
        * libc/stdio/freopen.c (freopen): Ditto.

newlib/ChangeLog
newlib/libc/stdio/fclose.c
newlib/libc/stdio/freopen.c

index 5e57a37a8c7bc58b1edfd2727765b600e4698401..1641d7b87620e743e6cb61017b6cc5ea23f9098a 100644 (file)
@@ -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.
index 630cd41920d708cf0e22b50c67ea01295da4b094..1caeb4cdea5a9607863799386f1e6ec4169fd874 100644 (file)
@@ -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);
 }
index 6d54789da111410ac59d32e1b66e264986194a5e..ba83dd215fac8db2d311347befb2ae251c9da881 100644 (file)
@@ -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;
     }
 
This page took 0.044496 seconds and 5 git commands to generate.