fix non-atomicity of puts
This commit is contained in:
parent
b470030f83
commit
8ae2fa6563
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue