return (NULL);
}
+ pthread_once(&__sdidinit, __sinit);
+
FLOCKFILE(fp);
- if (!__sdidinit)
- __sinit();
-
/*
* If the filename is a NULL pointer, the caller is asking us to
* re-open the same file with a different mode. We allow this only
memset(&fp->_mbstate, 0, sizeof(mbstate_t));
if (f < 0) { /* did not get it after all */
- __sfprelease(fp); /* set it free */
FUNLOCKFILE(fp);
+ __sfprelease(fp); /* set it free */
errno = sverrno; /* restore in case _close clobbered */
return (NULL);
}
* open.
*/
if (f > SHRT_MAX) {
- __sfprelease(fp); /* set it free */
FUNLOCKFILE(fp);
+ __sfprelease(fp); /* set it free */
errno = EMFILE;
return (NULL);
}