]> sourceware.org Git - newlib-cygwin.git/commitdiff
2004-01-15 Thomas Pfaff <tpfaff@gmx.net>
authorJeff Johnston <jjohnstn@redhat.com>
Thu, 15 Jan 2004 19:12:17 +0000 (19:12 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Thu, 15 Jan 2004 19:12:17 +0000 (19:12 +0000)
        * libc/stdio/fclose.c: Include sys/lock.h.
        (fclose): Destroy lock when file is closed.
        * libc/stdio/findfp.c (__sfp): Initialize file pointers _lock
        member.
        * libc/stdio/freopen.c: Include sys/lock.h.
        (_freopen_r): Destroy lock when file is closed.
        * libc/stdio/vfprintf.c (__sbprintf): Initialize file pointers
        _lock member.

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

index 5927e5701645ccecf23fc314c572d15da44354b9..4d84d50625b8af8610a674392838051b9733efac 100644 (file)
@@ -1,3 +1,14 @@
+2004-01-15  Thomas Pfaff  <tpfaff@gmx.net>
+
+       * libc/stdio/fclose.c: Include sys/lock.h.
+       (fclose): Destroy lock when file is closed.
+       * libc/stdio/findfp.c (__sfp): Initialize file pointers _lock
+       member.
+       * libc/stdio/freopen.c: Include sys/lock.h.
+       (_freopen_r): Destroy lock when file is closed.
+       * libc/stdio/vfprintf.c (__sbprintf): Initialize file pointers
+       _lock member.
+
 2004-01-08  Joel Sherrill  <joel@oarcorp.com>
 
         * libc/ctype/iswctype.c, include/sys/reent.h, libc/stdlib/a64l.c:
index b8cd51dc1809930190563c653989e878b6193f1d..630cd41920d708cf0e22b50c67ea01295da4b094 100644 (file)
@@ -50,6 +50,7 @@ Required OS subroutines: <<close>>, <<fstat>>, <<isatty>>, <<lseek>>,
 #include <stdio.h>
 #include <stdlib.h>
 #include "local.h"
+#include <sys/lock.h>
 
 /*
  * Close a file.
@@ -84,5 +85,9 @@ _DEFUN (fclose, (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
+
   return (r);
 }
index 2a907bb6d9ead780ee5e5028319b8136f7d985bf..efbb62561831685ebb8a07b58e35f9cbd3db4fa7 100644 (file)
@@ -114,6 +114,10 @@ found:
   fp->_ub._size = 0;
   fp->_lb._base = NULL;                /* no line buffer */
   fp->_lb._size = 0;
+#ifndef __SINGLE_THREAD__
+  memset (&fp->_lock, 0, sizeof(fp->_lock));
+#endif
+
   return fp;
 }
 
index 9010adcf798d37e8d7b9dffb6623e73244df35c7..6d54789da111410ac59d32e1b66e264986194a5e 100644 (file)
@@ -71,6 +71,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
 #include <fcntl.h>
 #include <stdlib.h>
 #include "local.h"
+#include <sys/lock.h>
 
 /*
  * Re-direct an existing, open (probably) file to some other file.
@@ -150,6 +151,9 @@ _DEFUN (_freopen_r, (ptr, file, mode, fp),
       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
       return NULL;
     }
 
index 7015740e020f7ade53bf3c61b5d20d0920eb6fd1..c13a7f70fa792d2a26a73609c71dc62d61e07fa4 100644 (file)
@@ -252,6 +252,9 @@ __sbprintf(fp, fmt, ap)
        fake._bf._base = fake._p = buf;
        fake._bf._size = fake._w = sizeof(buf);
        fake._lbfsize = 0;      /* not actually used, but Just In Case */
+#ifndef __SINGLE_THREAD__
+       memset (&fake._lock, 0, sizeof(fake._lock));
+#endif
 
        /* do the work, then copy any error status */
        ret = VFPRINTF(&fake, fmt, ap);
This page took 0.052372 seconds and 5 git commands to generate.