Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix-wizards Subject: Re: Runaway Sendmails Message-ID: <868@umcp-cs.UUCP> Date: Sat, 12-Apr-86 11:42:08 EST Article-I.D.: umcp-cs.868 Posted: Sat Apr 12 11:42:08 1986 Date-Received: Wed, 16-Apr-86 03:35:30 EST References: <56@uscvax.UUCP> Reply-To: chris@maryland.UUCP (Chris Torek) Organization: University of Maryland, Dept. of Computer Sci. Lines: 29 In article <56@uscvax.UUCP> pv@usc-cse.UUCP (Peter Vanderbilt) writes: >Several times in the last few weeks, we have had sendmails that create >infinite df* files (in /usr/spool/mqueue) -- the last line is repeated until >space runs out on /usr. I had to fix this once or twice. There are, as I recall, two loops in sendmail of the form while (!feof(infile)) { ... (void) fgets(buf, sizeof (buf), infile); if (ferror(infile)) [do something about error]; [append line to data file]; ... } The author obviously expected ferror(infile) to imply feof(infile); but it does not. A quick fix is to change the conditions on the loops to while (!feof(infile) && !ferror(infile)) (the loops are in fact `for's, if I recall correctly, so take care with your search strings; but this is not otherwise important). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu