}
/* Don't overwrite execve() failure with child exit status. */
- if (mc->cstat->type != CMD_ERRNO) {
+ if (mc->cstat->type == CMD_INVALID) {
/*
* Store wait status in cstat and forward to parent if stopped.
*/
__func__, (int)ec->cmnd_pid, WEXITSTATUS(status));
}
/* Don't overwrite execve() failure with command exit status. */
- if (ec->cstat->type != CMD_ERRNO) {
+ if (ec->cstat->type == CMD_INVALID) {
ec->cstat->type = CMD_WSTATUS;
ec->cstat->val = status;
}
/* Nothing ready. */
break;
default:
- if (ec->cstat->val != CMD_WSTATUS) {
+ if (ec->cstat->val == CMD_INVALID) {
ec->cstat->type = CMD_ERRNO;
ec->cstat->val = errno;
sudo_debug_printf(SUDO_DEBUG_ERROR,
break;
default:
/* Short read, should not happen. */
- if (ec->cstat->val != CMD_WSTATUS) {
+ if (ec->cstat->val == CMD_INVALID) {
ec->cstat->type = CMD_ERRNO;
ec->cstat->val = EIO;
sudo_debug_printf(SUDO_DEBUG_ERROR,