static char *process_name = NULL;
static char *current_process_title;
+static unsigned int process_title_counter = 0;
#ifdef HAVE_SETPROCTITLE
# undef PROCTITLE_HACK
{
i_assert(process_name != NULL);
+ process_title_counter++;
i_free(current_process_title);
current_process_title = i_strdup(title);
#ifdef HAVE_SETPROCTITLE
return current_process_title;
}
+unsigned int process_title_get_counter(void)
+{
+ return process_title_counter;
+}
+
void process_title_deinit(void)
{
#ifdef PROCTITLE_HACK
/* Return the previously set process title. NULL means that it's either not
set, or the title was explicitly set to NULL previously. */
const char *process_title_get(void);
+/* Return the number of times process_title_set() has been called. */
+unsigned int process_title_get_counter(void);
/* Free all memory used by process title hacks. This should be the last
function called by the process, since it frees argv and environment. */