From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Yet another failure mode in pg_upgrade |
Date: | 2012-09-01 18:23:22 |
Message-ID: | 19860.1346523802@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Bruce Momjian <bruce(at)momjian(dot)us> writes:
> + /*
> + * Report the Unix domain socket directory location to the postmaster.
> + */
"Report" seems entirely the wrong verb there.
> + #define LISTEN_STR " -c listen_addresses=''"
> +
> + /* Have a sockdir to use? */
> + if (strlen(os_info.sockdir) != 0)
> + snprintf(socket_string, sizeof(socket_string) - strlen(LISTEN_STR),
> + " -c %s='%s'",
> + (GET_MAJOR_VERSION(cluster->major_version) < 903) ?
> + "unix_socket_directory" : "unix_socket_directories",
> + os_info.sockdir);
> +
> + /* prevent TCP/IP connections */
> + strcat(socket_string, LISTEN_STR);
IMO this would be simpler and more readable if you got rid of the LISTEN_STR
#define and just included -c listen_addresses='' in the snprintf format
string. The comment for the whole thing should be something like
"If we have a socket directory to use, command the postmaster to use it,
and disable TCP/IP connections altogether".
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2012-09-01 18:35:06 | Re: Yet another failure mode in pg_upgrade |
Previous Message | Tom Lane | 2012-09-01 18:18:59 | Re: Yet another failure mode in pg_upgrade |