X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/224c70764cab4e0e39a26aaf3ad3016552f62f55..fbd86d4cc20b02a10edcca92fb7ae0a143e63cc4:/stdio/fclose-fbsd.c diff --git a/stdio/fclose-fbsd.c b/stdio/fclose-fbsd.c index bb54156..cd4ff1e 100644 --- a/stdio/fclose-fbsd.c +++ b/stdio/fclose-fbsd.c @@ -53,6 +53,9 @@ fclose(FILE *fp) { int r; + if (!__sdidinit) + __sinit(); + if (fp == NULL) { errno = EFAULT; return (EOF); @@ -73,7 +76,7 @@ fclose(FILE *fp) FREELB(fp); fp->_file = -1; fp->_r = fp->_w = 0; /* Mess up if reaccessed. */ - fp->_flags = 0; /* Release this FILE for reuse. */ + __sfprelease(fp); /* Release this FILE for reuse. */ FUNLOCKFILE(fp); return (r); }