From: Junio C Hamano Date: Sun, 07 Apr 2013 17:52:13 GMT Subject: Re: [PATCH v3 1/2] run-command: add new check_command helper Message-ID: <7vsj322ppu.fsf@alter.siamese.dyndns.org> In-Reply-To: <1365320706-13539-2-git-send-email-felipe.contreras@gmail.com> Felipe Contreras writes: > - while ((waiting = waitpid(pid, &status, 0)) < 0 && errno == EINTR) > - ; /* nothing */ > + /* First try the last status from check_command() */ > + if (cmd && cmd->last_status.valid) { > + status = cmd->last_status.status; > + waiting = pid; > + } else { > + while ((waiting = waitpid(pid, status, 0)) < 0 && errno == EINTR) > + ; /* nothing */ waitpid(pid, &status, 0), I presume.