*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.611 2010/06/03 21:02:11 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.612 2010/06/16 00:54:16 petere Exp $
*
* NOTES
*
(errmsg_internal("pg_getnameinfo_all() failed: %s",
gai_strerror(ret))));
}
- snprintf(remote_ps_data, sizeof(remote_ps_data),
- remote_port[0] == '\0' ? "%s" : "%s(%s)",
- remote_host, remote_port);
+ if (remote_port[0] == '\0')
+ snprintf(remote_ps_data, sizeof(remote_ps_data), "%s", remote_host);
+ else
+ snprintf(remote_ps_data, sizeof(remote_ps_data), "%s(%s)", remote_host, remote_port);
if (Log_connections)
{
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.53 2010/05/09 02:15:59 tgl Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.54 2010/06/16 00:54:16 petere Exp $ */
#include "postgres_fe.h"
{
hour = -(*tzp / SECS_PER_HOUR);
min = (abs(*tzp) / MINS_PER_HOUR) % MINS_PER_HOUR;
- sprintf(str + strlen(str), (min != 0) ? "%+03d:%02d" : "%+03d", hour, min);
+ if (min != 0)
+ sprintf(str + strlen(str), "%+03d:%02d", hour, min);
+ else
+ sprintf(str + strlen(str), "%+03d", hour);
}
break;
{
hour = -(*tzp / SECS_PER_HOUR);
min = (abs(*tzp) / MINS_PER_HOUR) % MINS_PER_HOUR;
- sprintf(str + strlen(str), (min != 0) ? "%+03d:%02d" : "%+03d", hour, min);
+ if (min != 0)
+ sprintf(str + strlen(str), "%+03d:%02d", hour, min);
+ else
+ sprintf(str + strlen(str), "%+03d", hour);
}
}
break;
{
hour = -(*tzp / SECS_PER_HOUR);
min = (abs(*tzp) / MINS_PER_HOUR) % MINS_PER_HOUR;
- sprintf(str + strlen(str), (min != 0) ? "%+03d:%02d" : "%+03d", hour, min);
+ if (min != 0)
+ sprintf(str + strlen(str), "%+03d:%02d", hour, min);
+ else
+ sprintf(str + strlen(str), "%+03d", hour);
}
}
break;
*/
hour = -(*tzp / SECS_PER_HOUR);
min = (abs(*tzp) / MINS_PER_HOUR) % MINS_PER_HOUR;
- sprintf(str + strlen(str), (min != 0) ? " %+03d:%02d" : " %+03d", hour, min);
+ if (min != 0)
+ sprintf(str + strlen(str), " %+03d:%02d", hour, min);
+ else
+ sprintf(str + strlen(str), " %+03d", hour);
}
}
break;