Annotation of researchv10no/cmd/spitbol/cint/flush.c, revision 1.1.1.1

1.1       root        1: 
                      2: /*
                      3:  *     flush( ioptr ) writes the characters in the buffer implied by ioptr.
                      4:  */
                      5: 
                      6: #include "spitblks.h"
                      7: #include "spitio.h"
                      8: 
                      9: int
                     10: flush( ioptr )
                     11: 
                     12: struct ioblk   *ioptr;
                     13: 
                     14: {
                     15:        register struct bfblk   *bfptr;
                     16:        register int    n, ioerrcnt = 0;
                     17: 
                     18:        bfptr   = ioptr -> buf;
                     19:        if ( bfptr ) {
                     20:                n = bfptr -> off;
                     21:                if ( n > 0 ) {
                     22:                        if ( write( ioptr -> fdn, bfptr -> buf, n ) != n )
                     23:                                ioerrcnt++;
                     24:                }
                     25:                bfptr -> off = 0;
                     26:                bfptr -> rem = bfptr -> siz;
                     27:        }
                     28:        return ioerrcnt;
                     29: }
                     30: 

unix.superglobalmegacorp.com

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