fix pghost bug

This commit is contained in:
yupeng
2020-08-31 18:52:35 +08:00
parent 18814f47dd
commit 52c85928d2
2 changed files with 2 additions and 19 deletions

View File

@ -1208,19 +1208,10 @@ static void CreateLockFile(const char* file_name, bool am_post_master, bool is_d
* the datadir lockfile later.
*/
char* unix_socket_dir = NULL;
char* pg_host = gs_getenv_r("PGHOST");
if (pg_host != NULL) {
check_backend_env(pg_host);
}
if (*g_instance.attr.attr_network.UnixSocketDir != '\0') {
unix_socket_dir = g_instance.attr.attr_network.UnixSocketDir;
} else {
if (pg_host != NULL && *(pg_host) != '\0') {
unix_socket_dir = pg_host;
} else {
unix_socket_dir = DEFAULT_PGSOCKET_DIR;
}
unix_socket_dir = DEFAULT_PGSOCKET_DIR;
}
int rc = snprintf_s(buffer,