diff options
author | Johannes Sixt <j6t@kdbg.org> | 2009-07-04 21:26:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-05 12:16:27 -0700 |
commit | 5709e0363a891b72eb9e9756d7fb121d9bf6a7c7 (patch) | |
tree | 47c33baed20745fe0f928ed86fd526ac13943622 /ll-merge.c | |
parent | 303e7c48eae7e140a9612ff1f9b5a95ca80b65c4 (diff) | |
download | git-5709e0363a891b72eb9e9756d7fb121d9bf6a7c7.tar.gz |
run_command: return exit code as positive value
As a general guideline, functions in git's code return zero to indicate
success and negative values to indicate failure. The run_command family of
functions followed this guideline. But there are actually two different
kinds of failure:
- failures of system calls;
- non-zero exit code of the program that was run.
Usually, a non-zero exit code of the program is a failure and means a
failure to the caller. Except that sometimes it does not. For example, the
exit code of merge programs (e.g. external merge drivers) conveys
information about how the merge failed, and not all exit calls are
actually failures.
Furthermore, the return value of run_command is sometimes used as exit
code by the caller.
This change arranges that the exit code of the program is returned as a
positive value, which can now be regarded as the "result" of the function.
System call failures continue to be reported as negative values.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'll-merge.c')
-rw-r--r-- | ll-merge.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/ll-merge.c b/ll-merge.c index a2c13c4c08..31c74578f6 100644 --- a/ll-merge.c +++ b/ll-merge.c @@ -192,10 +192,6 @@ static int ll_ext_merge(const struct ll_merge_driver *fn, args[2] = cmd.buf; status = run_command_v_opt(args, 0); - if (status < -ERR_RUN_COMMAND_FORK) - ; /* failure in run-command */ - else - status = -status; fd = open(temp[1], O_RDONLY); if (fd < 0) goto bad; |