From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <03f0a9eb6ff6ca4eacc10f6f28ad5114.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199702172004.OAA22959@atheist.tamu.edu> Date: Mon, 17 Feb 1997 14:04:20 -0600 (CST) From: Richard Henderson Subject: Re: fclose() In-Reply-To: <9702171347.ZM781@davros.bwh.com> > In professional world, I've seen far too many programs that close all > handles at termination, regardless of whether if known that handle is > open or not. It WOULD be nice to legislate good programming, I agree... *sigh* Well, there is a solution when you can't fix the source and that is use a different malloc that can handle multiple frees. This can be done by either explicitly linking with one when you are in control of such things or using LD_PRELOAD when you aren't. But the vast majority of the programs run under Linux *can* have their sources fixed, and most often it's just a silly little thing that only takes a few minutes, and so we should. > But legacy code rules, especially when practice is "sort of" backed up > by API specs. There is no API spec that allows "fclose(foo); fclose(foo);". As always, the effect is undefined/unpredictable. r~ -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com