]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - libio/iofclose.c
Wed May 8 20:04:29 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
[thirdparty/glibc.git] / libio / iofclose.c
index c797d86fd8b455950384f57323e465b484945250..e5cae966fd6ad1ccc2c2b3460664661a758fbf35 100644 (file)
@@ -35,6 +35,7 @@ _IO_fclose (fp)
 
   CHECK_FILE(fp, EOF);
 
+  _IO_flockfile (fp);
   if (fp->_IO_file_flags & _IO_IS_FILEBUF)
     status = _IO_file_close_it (fp);
   else
@@ -45,6 +46,7 @@ _IO_fclose (fp)
       fp->_IO_file_flags = 0;
       free(fp);
     }
+  _IO_funlockfile (fp);
   return status;
 }