{"thread":{"id":"28746","subject":"[PATCH 2/2] credential-cache--daemon.c: unlink() a potentially stale unix socket","startedAt":"2011-10-22T17:25:52Z","lastAt":"2011-10-22T19:19:06Z","messageCount":2,"participants":["Ramsay Jones","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"178166","messageId":"4EA2FCA0.70002@ramsay1.demon.co.uk","threadId":"28746","inReplyTo":null,"subject":"[PATCH 2/2] credential-cache--daemon.c: unlink() a potentially stale unix socket","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-10-22T17:25:52Z","receivedAt":"2011-10-22T17:25:52Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n credential-cache--daemon.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/credential-cache--daemon.c b/credential-cache--daemon.c\nindex ee2c15a..c5fb1b2 100644\n--- a/credential-cache--daemon.c\n+++ b/credential-cache--daemon.c\n@@ -230,6 +230,7 @@ static void serve_cache(const char *socket_path)\n {\n \tint fd;\n \n+\tunlink(socket_path);\n \tfd = unix_stream_listen(socket_path);\n \tif (fd < 0)\n \t\tdie_errno(\"unable to bind to '%s'\", socket_path);\n-- \n1.7.7\n"},{"id":"178180","messageId":"20111022191905.GD1785@sigill.intra.peff.net","threadId":"28746","inReplyTo":"4EA2FCA0.70002@ramsay1.demon.co.uk","subject":"Re: [PATCH 2/2] credential-cache--daemon.c: unlink() a potentially stale unix socket","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-10-22T19:19:06Z","receivedAt":"2011-10-22T19:19:06Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Oct 22, 2011 at 06:25:52PM +0100, Ramsay Jones wrote:\n\n> diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c\n> index ee2c15a..c5fb1b2 100644\n> --- a/credential-cache--daemon.c\n> +++ b/credential-cache--daemon.c\n> @@ -230,6 +230,7 @@ static void serve_cache(const char *socket_path)\n>  {\n>  \tint fd;\n>  \n> +\tunlink(socket_path);\n>  \tfd = unix_stream_listen(socket_path);\n>  \tif (fd < 0)\n>  \t\tdie_errno(\"unable to bind to '%s'\", socket_path);\n\nI think this is a sane thing to do, if it's more portable. We can just\nget rid of the double-bind attempt in unix_stream_listen, now. I suspect\nthis unlink should probably just go directly into unix_stream_listen,\ntoo.\n\n-Peff\n"}]}