Re: possible code error at run_command.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 21/12/2009, a las 07:46, Frank Li escribió:

int start_command(struct child_process *cmd)
{
	int need_in, need_out, need_err;
	int fdin[2], fdout[2], fderr[2];
	int failed_errno = failed_errno;

I have not found failed_errno as global variable.
failed_errno = failed_errno means nothing.

It is possible coding error and should be
int failed_errno= 0 or
failed_errno=errno.

Via "git blame":

commit 5a7a3671b74c043216549b94a718da04cc3ffcd6
Author: David Soria Parra <dsp@xxxxxxx>
Date:   Tue Aug 4 11:28:40 2009 +0200

    run-command.c: squelch a "use before assignment" warning

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@xxxxxxx>
    Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>


Cheers,
Wincent--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]