Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.sources.d Subject: Re: Inapproprtiae ioctl for user (Re: Comments on INSERT.c) Message-ID: <846@auspex.UUCP> Date: 14 Jan 89 07:13:57 GMT References: <308@twwells.uucp> <835@auspex.UUCP> <2728@ficc.uu.net> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 16 >It's not closely related, then, but it's the same basic problem... using >perror or errno where it's not meaningful. No, not really; the problem with "fprintf" followed by "perror" is that "errno" *is* meaningful before the "fprintf" but "fprintf" might destroy it, and the problem in "sendmail" is that it isn't meaningful at all. As such, the fixes are different as well: in the first case, you preserve "errno" (or generate the error message) before you call "fprintf", and in the second case, you somehow indicate whether you should bother doing anything with "errno" *at all*. The fix to the first problem doesn't apply to the second, nor does the fix to the second problem apply to the first.... You can apply a common fix - namely, don't use "errno" at all - but that is rather excessive for the first problem.