From d7a1feba67c3b1fbe47a186a5749c47034966a38 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 26 Aug 2010 22:00:32 +0000 Subject: Document the existence of the socket lock file under unix_socket_directory, which is perhaps not a terribly good spot for it but there doesn't seem to be a better place. Also add a source-code comment pointing out a couple reasons for having a separate lock file. Per suggestion from Greg Smith. --- src/backend/libpq/pqcomm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 360524f50ab..85350661cef 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -30,7 +30,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.212 2010/07/08 16:19:50 mha Exp $ + * $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.212.2.1 2010/08/26 22:00:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -484,6 +484,11 @@ Lock_AF_UNIX(unsigned short portNumber, char *unixSocketName) /* * Grab an interlock file associated with the socket file. + * + * Note: there are two reasons for using a socket lock file, rather than + * trying to interlock directly on the socket itself. First, it's a lot + * more portable, and second, it lets us remove any pre-existing socket + * file without race conditions. */ CreateSocketLockFile(sock_path, true); -- cgit v1.2.3