[OT] Re: return level?

Nick Simicich njs at scifi.squawk.com
Fri Feb 21 14:38:43 CET 2003


At 10:59 PM 2003-02-18 +0100, Matthias Andree wrote:

>Greg Louis <glouis at dynamicro.on.ca> writes:
>
> > And yours is more up to date.  A better source still is the current
> > glibc documentation:
> >
> > Exit Status
> > -----------
> >
> >    When a program exits, it can return to the parent process a small
> > amount of information about the cause of termination, using the "exit
> > status".  This is a value between 0 and 255 that the exiting process
> > passes as an argument to `exit'.
> >
> > So you're right: in this context, only the low 8 bits matter.
>
>May I ask all of the interested parties to read waitpid(2) instead? The
>original suspicion that 256 might be shifted by 8 bits is correct; the
>application that misrepresents the bogofilter exit code as being 256
>should have used the WEXITSTATUS macro (POSIX btw), but failed to do
>so. Fix the caller.

It is possible python does this to allow the caller to tell whether the 
command ended on a signal or normally in a single status value -- which is 
exactly what those macros do.  However, only one level of program can make 
that determination.  Unless there is a decision to do a "throw" or die 
equivalent if the command dies, keeping the status separate is the only way 
to allow the caller to tell "signal 1" from exit(1).

--
SPAM: Trademark for spiced, chopped ham manufactured by Hormel.
spam: Unsolicited, Bulk E-mail, where e-mail can be interpreted generally 
to mean electronic messages designed to be read by an individual, and it 
can include Usenet, SMS, AIM, etc.  But if it is not all three of 
Unsolicited, Bulk, and E-mail, it simply is not spam. Misusing the term 
plays into the hands of the spammers, since it causes confusion, and 
spammers thrive on  confusion. Spam is not speech, it is an action, like 
theft, or vandalism. If you were not confused, would you patronize a spammer?
Nick Simicich - njs at scifi.squawk.com - http://scifi.squawk.com/njs.html
Stop by and light up the world!



More information about the Bogofilter mailing list