Re: daemon caching weird exit status from a shell script
- From: "brasilino@xxxxxxxxx" <brasilino@xxxxxxxxx>
- Date: 21 Mar 2007 11:05:10 -0700
Hi Jens:
Have another look at the man page for waitpid(). The 'status'
you get back is a combination of the exit value of the program
and some additional information about the reasons the program
terminated (since there is not necessarily an exit value if the
process got killed e.g. due to an uncaught signal). Use the macro
WIFEXITED() on the 'status' value waitpid() reported and, if this
is true, you know there's an exit value and you can determine it
by using the WEXITSTATUS() on 'status'.
Thanks a lot. I was in a rush that I hadn't read the whole man page.
I think there's a mispelling there:
<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.
bests regards
Lucas Brasilino
.
- Follow-Ups:
- Re: daemon caching weird exit status from a shell script
- From: Jens Thoms Toerring
- Re: daemon caching weird exit status from a shell script
- References:
- daemon caching weird exit status from a shell script
- From: brasilino@xxxxxxxxx
- Re: daemon caching weird exit status from a shell script
- From: Jens Thoms Toerring
- daemon caching weird exit status from a shell script
- Prev by Date: Re: system() function
- Next by Date: Re: Is splint the best for static code checking? I mean free.
- Previous by thread: Re: daemon caching weird exit status from a shell script
- Next by thread: Re: daemon caching weird exit status from a shell script
- Index(es):
Relevant Pages
|