]> pd.if.org Git - pdclib/blobdiff - functions/stdio/fflush.c
Removed SVN keyword tags.
[pdclib] / functions / stdio / fflush.c
index b8d32ec307d45b389d3a0fa37fb79263998e9f16..85bd234b5a94cca01ea0b3a403b4b9d1a060bf1b 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* fflush( FILE * )
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -9,11 +7,11 @@
 #include <stdio.h>
 
 #ifndef REGTEST
-#include <_PDCLIB_glue.h>
+#include <_PDCLIB_io.h>
 
-extern struct _PDCLIB_file_t * _PDCLIB_filelist;
+extern FILE * _PDCLIB_filelist;
 
-int fflush( struct _PDCLIB_file_t * stream )
+int _PDCLIB_fflush_unlocked( FILE * stream )
 {
     if ( stream == NULL )
     {
@@ -38,6 +36,14 @@ int fflush( struct _PDCLIB_file_t * stream )
         return _PDCLIB_flushbuffer( stream );
     }
 }
+
+int fflush( FILE * stream )
+{
+    _PDCLIB_flockfile( stream );
+    int res = _PDCLIB_fflush_unlocked(stream);
+    _PDCLIB_funlockfile( stream );
+    return res;
+}
                 
 #endif