diff options
Diffstat (limited to 'src/include/libpq/pqcomm.h')
-rw-r--r-- | src/include/libpq/pqcomm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h index 781d86c8efa..cf967c39871 100644 --- a/src/include/libpq/pqcomm.h +++ b/src/include/libpq/pqcomm.h @@ -85,6 +85,15 @@ typedef struct */ #define UNIXSOCK_PATH_BUFLEN sizeof(((struct sockaddr_un *) NULL)->sun_path) +/* + * A host that looks either like an absolute path or starts with @ is + * interpreted as a Unix-domain socket address. + */ +static inline bool +is_unixsock_path(const char *path) +{ + return is_absolute_path(path) || path[0] == '@'; +} /* * These manipulate the frontend/backend protocol version number. |