Checking Exit Codes (was: Re: Trojan Horses)

John F. Haugh II jfh at rpp386.cactus.org
Fri Oct 26 22:51:19 AEST 1990


In article <8645:Oct2521:49:5790 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>In article <1893 at necisa.ho.necisa.oz> boyd at necisa.ho.necisa.oz (Boyd Roberts) writes:
>> Surely you mean that if you don't know how to handle a specific recovery
>> (for some unspecified error type) it's still treated as failure?
>
>Not at all. This might be true for calls that give me information, but
>close() is not such a call. Do you check the return value of assert()?

Sure, why not.  You do know that assert() is documented as returning
to the invoker?  You have to read the abort() page to find this out,
but coding

	assert (some impossible condition);
	function (! some impossible condition allowed);

is naive in non-user code.  What is going to happen one day when the
user does

	for (i = 1;i < NSIG;i++)
		(void) signal (i, SIG_IGN);

You better start checking the return code for assert() as well.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org
"SCCS, the source motel!  Programs check in and never check out!"
		-- Ken Thompson



More information about the Comp.unix.internals mailing list