From: Jeff King Date: Wed, 28 Jan 2009 07:36:39 +0000 (-0500) Subject: run_command(): help callers distinguish errors X-Git-Tag: v1.6.2-rc0~37^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1d64f21d9949ac1dd59fa722160e46181d92854d;p=git.git run_command(): help callers distinguish errors run_command() returns a single integer specifying either an error code or the exit status of the spawned program. The only way to tell the difference is that the error codes are outside of the allowed range of exit status values. Rather than make each caller implement the test against a magic limit, let's provide a macro. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/run-command.h b/run-command.h index a8b0c209e..e90d9282f 100644 --- a/run-command.h +++ b/run-command.h @@ -10,6 +10,7 @@ enum { ERR_RUN_COMMAND_WAITPID_SIGNAL, ERR_RUN_COMMAND_WAITPID_NOEXIT, }; +#define IS_RUN_COMMAND_ERR(x) ((x) <= -ERR_RUN_COMMAND_FORK) struct child_process { const char **argv;