X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..refs/heads/master:/stdio/FreeBSD/ungetc.c?ds=inline diff --git a/stdio/FreeBSD/ungetc.c b/stdio/FreeBSD/ungetc.c index fc8ddb1..287fa02 100644 --- a/stdio/FreeBSD/ungetc.c +++ b/stdio/FreeBSD/ungetc.c @@ -92,8 +92,8 @@ ungetc(int c, FILE *fp) { int ret; - if (!__sdidinit) - __sinit(); + pthread_once(&__sdidinit, __sinit); + FLOCKFILE(fp); ORIENT(fp, -1); ret = __ungetc(c, fp);