From: Jeff King <peff@peff.net>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] credential-cache--daemon.c: unlink() a potentially stale unix socket
Date: Sat, 22 Oct 2011 15:19:06 -0400 [thread overview]
Message-ID: <20111022191905.GD1785@sigill.intra.peff.net> (raw)
In-Reply-To: <4EA2FCA0.70002@ramsay1.demon.co.uk>
On Sat, Oct 22, 2011 at 06:25:52PM +0100, Ramsay Jones wrote:
> diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c
> index ee2c15a..c5fb1b2 100644
> --- a/credential-cache--daemon.c
> +++ b/credential-cache--daemon.c
> @@ -230,6 +230,7 @@ static void serve_cache(const char *socket_path)
> {
> int fd;
>
> + unlink(socket_path);
> fd = unix_stream_listen(socket_path);
> if (fd < 0)
> die_errno("unable to bind to '%s'", socket_path);
I think this is a sane thing to do, if it's more portable. We can just
get rid of the double-bind attempt in unix_stream_listen, now. I suspect
this unlink should probably just go directly into unix_stream_listen,
too.
-Peff
prev parent reply other threads:[~2011-10-22 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-22 17:25 [PATCH 2/2] credential-cache--daemon.c: unlink() a potentially stale unix socket Ramsay Jones
2011-10-22 19:19 ` Jeff King [this message]
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=20111022191905.GD1785@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).