Skip to content

Commit

Permalink
Check that cluster_name is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Kukushkin committed May 28, 2018
1 parent 4aadac3 commit 78f34be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions postgres_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,10 @@ void postgres_stats_init(void)
cmdline_prefix = palloc(cmdline_prefix_len + 1);
strcpy(cmdline_prefix, "postgres: ");
#if PG_VERSION_NUM >= 90500
strcpy(cmdline_prefix + 10, cluster_name);
strcpy(cmdline_prefix + cmdline_prefix_len - 2, ": ");
if (*cluster_name != '\0') {
strcpy(cmdline_prefix + 10, cluster_name);
strcpy(cmdline_prefix + cmdline_prefix_len - 2, ": ");
}
#endif

sprintf(postmaster_pid, " %d ", PostmasterPid);
Expand Down

0 comments on commit 78f34be

Please sign in to comment.