From: "Shawn O. Pearce" <spearce@spearce•org>
To: Junio C Hamano <junkio@cox•net>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 1/2] Don't leak file descriptors from unavailable pack files.
Date: Fri, 2 Feb 2007 03:53:43 -0500 [thread overview]
Message-ID: <20070202085343.GD20832@spearce.org> (raw)
In-Reply-To: <7vbqkdhs4d.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox•net> wrote:
> I agree leaking fd is not nice, but I wonder if that should be
> dealt with by the caller.
>
> Originally it did not matter as open_packed_git() died, but
> shouldn't it be closing the fd and marking p->pack_fd with -1, as
> you made it return instead of die?
Yea, I thought of that when I wrote that evil patch...
But open_packed_git has 12 things that can cause it to return
an error. That's basically a rewrite of the function. This was
4 lines added to the only caller which didn't die().
Probably the wrong thing to do. But the patch was shorter!
Do you want to reject this patch and have me rewrite open_packed_git
instead?
--
Shawn.
next prev parent reply other threads:[~2007-02-02 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-02 8:00 [PATCH 1/2] Don't leak file descriptors from unavailable pack files Shawn O. Pearce
2007-02-02 8:37 ` Junio C Hamano
2007-02-02 8:53 ` Shawn O. Pearce [this message]
2007-02-03 5:33 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070202085343.GD20832@spearce.org \
--to=spearce@spearce$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=junkio@cox$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox