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