Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
- index 57aa384..4baacad 100644
- --- a/src/backend/utils/misc/ps_status.c
- +++ b/src/backend/utils/misc/ps_status.c
- @@ -29,6 +29,7 @@
- #include "libpq/libpq.h"
- #include "miscadmin.h"
- #include "utils/ps_status.h"
- +#include "utils/guc.h"
- extern char **environ;
- bool update_process_title = true;
- @@ -289,6 +290,8 @@ void
- set_ps_display(const char *activity, bool force)
- {
- #ifndef PS_USE_NONE
- + int ps_buffer_dynamic_len;
- +
- /* update_process_title=off disables updates, unless force = true */
- if (!force && !update_process_title)
- return;
- @@ -303,9 +306,21 @@ set_ps_display(const char *activity, bool force)
- return;
- #endif
- + ps_buffer_dynamic_len = 0;
- + if (application_name)
- + {
- + strlcpy(ps_buffer + ps_buffer_fixed_size, application_name,
- + ps_buffer_size - ps_buffer_fixed_size);
- + ps_buffer_dynamic_len = strlen(application_name);
- + strlcpy(ps_buffer + ps_buffer_fixed_size + ps_buffer_dynamic_len, " ",
- + ps_buffer_size - ps_buffer_fixed_size - ps_buffer_dynamic_len);
- + ps_buffer_dynamic_len++;
- + }
- +
- /* Update ps_buffer to contain both fixed part and activity */
- - strlcpy(ps_buffer + ps_buffer_fixed_size, activity,
- - ps_buffer_size - ps_buffer_fixed_size);
- + strlcpy(ps_buffer + ps_buffer_fixed_size + ps_buffer_dynamic_len, activity,
- + ps_buffer_size - ps_buffer_fixed_size - ps_buffer_dynamic_len);
- +
- ps_buffer_cur_len = strlen(ps_buffer);
- /* Transmit new setting to kernel, if necessary */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement