X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fputs.c;h=4e5522695d76dafcaef018ca6ab409144921f127;hb=84d648157e22cecc65902ecfdd4e3a1b88d5e53f;hp=ec67478ddace2d36a2d303c8e3943d71b4955891;hpb=fce9a8538009ea5c113b03c608cedf036ce4a364;p=pdclib.old diff --git a/functions/stdio/puts.c b/functions/stdio/puts.c index ec67478..4e55226 100644 --- a/functions/stdio/puts.c +++ b/functions/stdio/puts.c @@ -13,7 +13,7 @@ extern char * _PDCLIB_eol; -int puts( const char * s ) +int puts_unlocked( const char * s ) { if ( _PDCLIB_prepwrite( stdout ) == EOF ) { @@ -42,6 +42,14 @@ int puts( const char * s ) } } +int puts( const char * s ) +{ + flockfile( stdout ); + int r = puts_unlocked( s ); + funlockfile( stdout ); + return r; +} + #endif #ifdef TEST