X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Frewind.c;h=53ab51da9509b64a2fcb1567fb05a8b45de5eb45;hb=0a419d48138f1411d6e3e50a367b9ece5a2cf893;hp=4dab8e9e2cbe9943392011876bf9723a060005b9;hpb=393020b6e48719d27699dea6b29e53025bbd5123;p=pdclib diff --git a/functions/stdio/rewind.c b/functions/stdio/rewind.c index 4dab8e9..53ab51d 100644 --- a/functions/stdio/rewind.c +++ b/functions/stdio/rewind.c @@ -9,11 +9,19 @@ #include #ifndef REGTEST +#include <_PDCLIB_io.h> -void rewind( struct _PDCLIB_file_t * stream ) +void rewind_unlocked( FILE * stream ) { stream->status &= ~ _PDCLIB_ERRORFLAG; - fseek( stream, 0L, SEEK_SET ); + fseek_unlocked( stream, 0L, SEEK_SET ); +} + +void rewind( FILE * stream ) +{ + flockfile(stream); + rewind_unlocked(stream); + funlockfile(stream); } #endif