fix some minor issues in cancellation handling patch
[musl] / src / stdio / puts.c
index eb70efd..4c0e583 100644 (file)
@@ -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;
 }