Loading...
stdio/FreeBSD/wsetup.c Libc-763.13 Libc-1698.140.3
--- Libc/Libc-763.13/stdio/FreeBSD/wsetup.c
+++ Libc/Libc-1698.140.3/stdio/FreeBSD/wsetup.c
@@ -47,12 +47,10 @@
  * _wsetup returns 0 if OK to write; otherwise, it returns EOF and sets errno.
  */
 int
-__swsetup(fp)
-	FILE *fp;
+__swsetup(FILE *fp)
 {
 	/* make sure stdio is set up */
-	if (!__sdidinit)
-		__sinit();
+	pthread_once(&__sdidinit, __sinit);
 
 	/*
 	 * If we are not writing, we had better be reading and writing.