Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!rutgers!gatech!mcnc!rti!trt From: trt@rti.UUCP (Thomas Truscott) Newsgroups: comp.os.minix Subject: Re: standard I/O and exit/_exit Message-ID: <1542@rti.UUCP> Date: Mon, 6-Jul-87 12:25:48 EDT Article-I.D.: rti.1542 Posted: Mon Jul 6 12:25:48 1987 Date-Received: Tue, 7-Jul-87 05:51:07 EDT References: <3118@felix.UUCP> <2352@hoptoad.uucp> <3169@felix.UUCP> <374@nikhefh.UUCP> Organization: Research Triangle Institute, NC Lines: 24 This is off the subject, but is one of my pet annoyances: > static __stdio_cleanup () > { > register int i; > > for ( i=0; i<_NFILE; i++ ) /* for all streams */ > fclose ( _iobuf[i] ); /* close it */ > } Please make the 'fclose()' an 'fflush()' instead That would avoid the pointless close(0); close(1); close(2); sequence at the end of *every* stdio-linked program. I did this back in 1979 and have yet to encounter a bug. It is ironic that the comment for _cleanup() is usually /* * Flush buffers on exit */ And then it calls fclose() instead! Tom Truscott