]> pd.if.org Git - pdclib.old/blobdiff - functions/stdio/ferror.c
[gandr] s/__lp64__/__LP64__/ to match GCC define
[pdclib.old] / functions / stdio / ferror.c
index 7ca531ed441bb00eec8b35e59370b6928f7aa798..07ecde7228774b237f6a5fbdbaa2ec8c93e973cc 100644 (file)
@@ -9,12 +9,21 @@
 #include <stdio.h>
 
 #ifndef REGTEST
+#include <_PDCLIB_io.h>
 
-int ferror( struct _PDCLIB_file_t * stream )
+int _PDCLIB_ferror_unlocked( FILE * stream )
 {
     return stream->status & _PDCLIB_ERRORFLAG;
 }
 
+int ferror( FILE * stream )
+{
+    _PDCLIB_flockfile( stream );
+    int error = _PDCLIB_ferror_unlocked( stream );
+    _PDCLIB_funlockfile( stream );
+    return error;
+}
+
 #endif
 
 #ifdef TEST