[PATCH 2/6] run-command: initialize failed_errno to 0
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 16, 2011, 11:36 UTC
- Message-ID
- <20110316113652.GD15739@elie>
- In-Reply-To
- <20110316113540.GB15739@elie>
It is much better to report "Success" than a seemingly random error message based on an uninitialized value.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- run-command.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/run-command.c b/run-command.c index f4fb936..8bb4d62 100644 --- a/run-command.c +++ b/run-command.c @@ -139,7 +139,7 @@ int start_command(struct child_process *cmd) { int need_in, need_out, need_err; int fdin[2], fdout[2], fderr[2]; - int failed_errno; + int failed_errno = 0; /* * In case of errors we must keep the promise to close FDs
-- 1.7.4.1