X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fferror.c;h=394dcda2bc7dd07dee9cad93b61dfd95ec50ddd1;hb=e6d28b5afddd8b3e3564af2264aa8b705e711b67;hp=b6f51ee6092ffe077edb769cca3dc0cb8f418492;hpb=13ee02fa27a739d9d602f801126eadcfbfeab8a8;p=pdclib diff --git a/functions/stdio/ferror.c b/functions/stdio/ferror.c index b6f51ee..394dcda 100644 --- a/functions/stdio/ferror.c +++ b/functions/stdio/ferror.c @@ -10,11 +10,19 @@ #ifndef REGTEST -int ferror( struct _PDCLIB_file_t * stream ) +int ferror_unlocked( struct _PDCLIB_file_t * stream ) { return stream->status & _PDCLIB_ERRORFLAG; } +int ferror( struct _PDCLIB_file_t * stream ) +{ + flockfile( stream ); + int error = ferror_unlocked( stream ); + funlockfile( stream ); + return error; +} + #endif #ifdef TEST @@ -22,8 +30,9 @@ int ferror( struct _PDCLIB_file_t * stream ) int main( void ) { - TESTCASE( NO_TESTDRIVER ); + /* Testing covered by clearerr(). */ return TEST_RESULTS; } #endif +