X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..6dccf0e0b5e80b7b6176e8d332e646175431bb3d:/stdio/FreeBSD/fseek.c diff --git a/stdio/FreeBSD/fseek.c b/stdio/FreeBSD/fseek.c index 24c424e..9f45c9b 100644 --- a/stdio/FreeBSD/fseek.c +++ b/stdio/FreeBSD/fseek.c @@ -60,8 +60,7 @@ fseek(fp, offset, whence) int serrno = errno; /* make sure stdio is set up */ - if (!__sdidinit) - __sinit(); + pthread_once(&__sdidinit, __sinit); FLOCKFILE(fp); ret = _fseeko(fp, (off_t)offset, whence, 1); @@ -81,8 +80,7 @@ fseeko(fp, offset, whence) int serrno = errno; /* make sure stdio is set up */ - if (!__sdidinit) - __sinit(); + pthread_once(&__sdidinit, __sinit); FLOCKFILE(fp); ret = _fseeko(fp, offset, whence, 0);