<div dir="ltr">On Sat, Sep 21, 2013 at 11:12 PM, Michael Xavier <span dir="ltr">&lt;<a href="mailto:michael@michaelxavier.net" target="_blank">michael@michaelxavier.net</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I&#39;ve run into some strangeness with the process package. When you kill some processes on the command line you correctly get a non-zero exit status. However when using the process package&#39;s terminateProcess (which sends a SIGTERM), it returns an ExitSuccess:</div>
</blockquote><div><br></div><div>The 143 you get from the shell is synthetic (and nonportable). Signals are not normal exit codes; WEXITSTATUS is not defined in this case (but often will be 0, as seems to be shown here), instead WTERMSIG will be set to the signal that terminated the process. The caller should be using WIFEXITED / WIFSIGNALED / WIFSTOPPED to determine the cause of the termination and then the appropriate WEXITSTATUS / WTERMSIG / WSTOPSIG call to determine the value.</div>
<div><br></div><div>It sounds like the createProcess API does not recognize signal exit at all, and uses WEXITSTATUS even when it is not valid.</div><div><br></div></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div>
<div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div>
</div>
</div></div>