Re: [PATCH] Don't try to reclose in command_close_bidi_pipe

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

 



Hi,

On Fri, Jan 30, 2009 at 12:59 PM, Yuval Kogman <nothingmuch@xxxxxxxxxxxx> wrote:
> Some commands require their standard input to be closed (like
> git-commit-tree). This patch changes command_close_bidi_pipe so no
> longer tries to close already closed handles, resulting in an error.

>From this message, you seem to intend this as a fix. Can you tell us
how one might go about to reproduce this issue?

> ---
>  perl/Git.pm |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/perl/Git.pm b/perl/Git.pm
> index 7d7f2b1..283bba8 100644
> --- a/perl/Git.pm
> +++ b/perl/Git.pm
> @@ -422,6 +422,7 @@ sub command_close_bidi_pipe {
>        local $?;
>        my ($pid, $in, $out, $ctx) = @_;
>        foreach my $fh ($in, $out) {
> +               next unless defined(fileno($fh));

Quoting the perldoc for fileno at http://perldoc.perl.org/functions/fileno.html

"(Filehandles connected to memory objects via new features of open may
return undefined even though they are open.)"

Is "unless defined(fileno($fh))" a reliable way to check if the handle
is closed?

-- 
Cheers,
Ray Chuan
--
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]

  Powered by Linux