joe@cca.UUCP (Joseph Chapman) (01/04/85)
<> > Under normal circumstances, the infinite loop you describe should never > happen. If this really is a problem, then some code should be put in > getchar() so that it doesn't call error() if it is being invoked by > error(). But the fix that was posted is definitely the wrong thing to > do. The call to error() in fflush is important, as there are a number > of legitimate reasons for the write to fail, and the user needs to be > notified about them. For example, if the disk fills up, the old code > would warn the user with a message telling him exactly what happened. > The code represented by the fix would be silent, and the user would get > the disastrously mistaken impression that his file was written > correctly. For these reasons, I strongly recommend against installing > the first part of the fix that was posted. Yes, that is true; mea culpa, mea maxima culpa. I included it because the infinite loop I described actually did occur under what I took to be normal circumstances. I suppose I should have posted a less complacent fix; until I or someone else comes up with one the question of which is the more ominous possibility, ringing bells or bit-buckets, is best left to the reader. I intend to take Steve Zimmerman's advice... Joe Chapman