run-command.c: squelch a "use before assignment" warning
authorDavid Soria Parra <dsp@php.net>
Tue, 4 Aug 2009 09:28:40 +0000 (11:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Aug 2009 17:04:29 +0000 (10:04 -0700)
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490) compiler
(and probably others) mistakenly thinks variable failed_errno is used
before assigned.  Work it around by giving it a fake initialization.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c

index b613bddc717b98d29ff54a852e99332a2fa6fdc8..71f83368c4e97357c782658135982e89c13ae414 100644 (file)
@@ -19,7 +19,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 = failed_errno;
 
        /*
         * In case of errors we must keep the promise to close FDs