* 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-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:
#include <stdio.h>
#include <stdlib.h>
#include "local.h"
+#include <sys/lock.h>
/*
* Close a file.
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);
}
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;
}
#include <fcntl.h>
#include <stdlib.h>
#include "local.h"
+#include <sys/lock.h>
/*
* Re-direct an existing, open (probably) file to some other file.
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;
}
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);