credential-cache--daemon.c: unlink() a potentially stale unix socket
PATCH 2/2 credential-cache--daemon.c: unlink() a potentially stale unix socket
Signed-off-by Ramsay Jones <[email protected]>
--- credential-cache--daemon.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
credential-cache--daemon.c +1 -0
@@ -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);
Signature · 1 line
1.7.7
credential-cache--daemon.c static void serve_cache(const char *socket_path) · line 236
Quoted 12 lines · Ramsay Jones
credential-cache--daemon.c +1
-0@@ -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