mirror of
https://git.musl-libc.org/git/musl
synced 2025-02-08 22:34:20 +03:00
fix non-atomicity of puts
This commit is contained in:
parent
b470030f83
commit
8ae2fa6563
@ -2,5 +2,9 @@
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user