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/fclose.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'newlib/libc/stdio/fclose.c') diff --git a/newlib/libc/stdio/fclose.c b/newlib/libc/stdio/fclose.c index b8cd51dc1..630cd4192 100644 --- a/newlib/libc/stdio/fclose.c +++ b/newlib/libc/stdio/fclose.c @@ -50,6 +50,7 @@ Required OS subroutines: <>, <>, <>, <>, #include #include #include "local.h" +#include /* * 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); } -- cgit v1.2.3