mirror of
https://github.com/fluencelabs/musl
synced 2025-06-26 21:22:11 +00:00
fix non-atomicity of puts
This commit is contained in:
@ -2,5 +2,9 @@
|
|||||||
|
|
||||||
int puts(const char *s)
|
int puts(const char *s)
|
||||||
{
|
{
|
||||||
return -(fputs(s, stdout) < 0 || putchar('\n') < 0);
|
int r;
|
||||||
|
FLOCK(stdout);
|
||||||
|
r = -(fputs(s, stdout) < 0 || putchar('\n') < 0);
|
||||||
|
FUNLOCK(stdout);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user