X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstdio%2Fputs.c;h=5a38a49b975adcad3192eda3148ef1acf55ad0df;hb=94a0171d807dc94302d6505041fc58879c27f3bd;hp=eb70efdc217bedb99c9db217d96bc706f688d150;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/puts.c b/src/stdio/puts.c index eb70efdc..5a38a49b 100644 --- a/src/stdio/puts.c +++ b/src/stdio/puts.c @@ -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 || putc_unlocked('\n', stdout) < 0); + FUNLOCK(stdout); + return r; }