Re: daemon caching weird exit status from a shell script



brasilino@xxxxxxxxx <brasilino@xxxxxxxxx> wrote:
<snipet>
WEXITSTATUS(status)
evaluates to the least significant eight bits of the
return code
of the child which terminated, which may have been
set as the....
</snipet>

It evaluates the *most* significant eight bits... not the *least* one,
as I could see.

Actually no - WEXITSTATUS() returns only the least significant eight
bits of the value the program returned, so if it returns something
above 255 the value is truncated. Where those bits are stored in
the value you got back from waitpid() isn't meant by the above and
it shouldn't be of any concern to you, the macro exists just for the
purpose that you don't have to know - some other system than the one
you are currently using might store the return value somewhere else
in 'status', but on such a system WEXITSTATUS() will be defined accor-
dingly and you can run your program without applying any changes.

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.