* [PATCH 2/2] credential-cache--daemon.c: unlink() a potentially stale unix socket
@ 2011-10-22 17:25 Ramsay Jones
2011-10-22 19:19 ` Jeff King
0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2011-10-22 17:25 UTC (permalink / raw)
To: Jeff King; +Cc: GIT Mailing-list
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
credential-cache--daemon.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
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);
--
1.7.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] credential-cache--daemon.c: unlink() a potentially stale unix socket
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
0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2011-10-22 19:19 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-22 19:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).