Annotation of coherent/d/lib/libc/stdio/fclose.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Standard I/O Library
        !             3:  * flush unwritten data, release allocated buffers, call sys close
        !             4:  */
        !             5: 
        !             6: #include <stdio.h>
        !             7: 
        !             8: int
        !             9: fclose(fp)
        !            10: register FILE  *fp;
        !            11: {
        !            12:        register int    st;
        !            13: 
        !            14:        if (!(fp->_ff&_FINUSE))
        !            15:                return (EOF);
        !            16:        st = fflush(fp);
        !            17:        close(fileno(fp));
        !            18:        if (fp->_bp!=NULL && !(fp->_ff&_FSTBUF))
        !            19:                free(fp->_bp);
        !            20:        fp->_ff = 0;
        !            21:        return (st);
        !            22: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.