Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-01-28 10:36:39 +0300
committerJunio C Hamano <gitster@pobox.com>2009-01-29 01:09:35 +0300
commit1d64f21d9949ac1dd59fa722160e46181d92854d (patch)
treeea38efd5e19ff0c219e1f8f17394c873925fe852 /run-command.h
parent45c0961c87884a04517b65c0acc6aedeeae2d0c8 (diff)
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.h')
-rw-r--r--run-command.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/run-command.h b/run-command.h
index a8b0c209e9..e90d9282ff 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;