X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffflush.c;h=df458804dc3099274f024286c3c55db2091418d8;hb=29387e76cd5cd340fe7d811dc9830931d3d0ec9b;hp=b8d32ec307d45b389d3a0fa37fb79263998e9f16;hpb=393020b6e48719d27699dea6b29e53025bbd5123;p=pdclib diff --git a/functions/stdio/fflush.c b/functions/stdio/fflush.c index b8d32ec..df45880 100644 --- a/functions/stdio/fflush.c +++ b/functions/stdio/fflush.c @@ -13,7 +13,7 @@ extern struct _PDCLIB_file_t * _PDCLIB_filelist; -int fflush( struct _PDCLIB_file_t * stream ) +int fflush_unlocked( struct _PDCLIB_file_t * stream ) { if ( stream == NULL ) { @@ -38,6 +38,14 @@ int fflush( struct _PDCLIB_file_t * stream ) return _PDCLIB_flushbuffer( stream ); } } + +int fflush( struct _PDCLIB_file_t * stream ) +{ + flockfile( stream ); + int res = fflush_unlocked(stream); + funlockfile( stream ); + return res; +} #endif