pgpool2.git / summary / log / commit / refs
commit 4c23c9b84bcaac627c2cd03d740ddb549b2012f2
Author: Muhammad Usama <m.usama@gmail.com>
Date: Mon Aug 29 14:32:31 2016 +0000
Fix for 237: Pgpool-II fails to start if listen_addresses is empty string
The socket descriptor array (fds[]) was not getting the array end marker
when TCP listen addresses are not used.
src/main/pgpool_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c
index 3b1fa7386..5b695a859 100644
--- a/src/main/pgpool_main.c
+++ b/src/main/pgpool_main.c
@@ -223,7 +223,7 @@ int PgpoolMain(bool discard_status, bool clear_memcache_oidmaps)
pool_signal(SIGPIPE, SIG_IGN);
/* create unix domain socket */
- fds = malloc(sizeof(int));
+ fds = malloc(sizeof(int) * 2);
if (fds == NULL)
ereport(FATAL,
(errmsg("failed to allocate memory in startup process")));
@@ -293,6 +293,7 @@ int PgpoolMain(bool discard_status, bool clear_memcache_oidmaps)
}
fds[0] = create_unix_domain_socket(un_addr);
+ fds[1] = -1;
on_proc_exit(FileUnlink, (Datum) un_addr.sun_path);
/* create inet domain socket if any */
[parent: d8cedce4f8f0]