X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;ds=sidebyside;f=functions%2Fstdio%2Fputs.c;fp=functions%2Fstdio%2Fputs.c;h=4e5522695d76dafcaef018ca6ab409144921f127;hb=6ca24b75c75b9c6f22e1e69693d326b8e3330841;hp=ec67478ddace2d36a2d303c8e3943d71b4955891;hpb=6cb7e8dab67e8807aad79c3bdc8f96d78a5e5dbc;p=pdclib 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