<span style='font-family:Verdana'><span style='font-size:12px'>Hello,<div> </div><div>I'm attaching a patch with the following change-log:</div><div>Add missing header against WEXITSTATUS()</div><div> </div><div>WEXITSTATUS is defined in sys/wait.h.</div><div> </div><div> </div><div> </div><div>Please apply the patch.</div><div> </div><div>As a side note this code (build/pack.c) looks suspicious:</div><div><div>static rpmRC checkPackages(char *pkgcheck)</div><div>{</div><div>    int fail = rpmExpandNumeric("%{?_nonzero_exit_pkgcheck_terminate_build}");</div><div>    int xx;</div><div>    </div><div>    rpmlog(RPMLOG_NOTICE, _("Executing \"%s\":\n"), pkgcheck);</div><div>    xx = system(pkgcheck);</div><div>    if (WEXITSTATUS(xx) == -1 || WEXITSTATUS(xx) == 127) {</div><div>rpmlog(RPMLOG_ERR, _("Execution of \"%s\" failed.\n"), pkgcheck);</div><div>if (fail) return RPMRC_NOTFOUND;</div><div>    }</div><div>    if (WEXITSTATUS(xx) != 0) {</div><div>rpmlog(RPMLOG_ERR, _("Package check \"%s\" failed.\n"), pkgcheck);</div><div>if (fail) return RPMRC_FAIL;</div><div>    }</div><div>    </div><div>    return RPMRC_OK;</div><div>}</div></div><div> </div><div>1. We lost errno.</div><div>2. WEXITSTATUS(xx) == -1 does the standard guarantee that this evaluates on all POSIX Unices as true? From what I saw in Unix manuals [1] here the result status is evaluated to low-order byte, so it would be better to compare it with 255 (to ignore signed/unsigned conversions), or better: to stop using WEXITSTATUS macro for this particular scenario and compare xx as it is with -1.</div><div> </div><div>[1] like http://modman.unixdev.net/?sektion=2&page=WEXITSTATUS&manpath=SunOS-4.1.3</div></span></span>