From 6a150987938abfef78f72d0bf4ed6b427b25e040 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 15 Jan 2004 19:12:17 +0000 Subject: 2004-01-15 Thomas Pfaff * 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/libc/stdio/findfp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'newlib/libc/stdio/findfp.c') diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index 2a907bb6d..efbb62561 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -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; } -- cgit v1.2.3