process-title.c revision cd2ed64888b42b481cde6bb9548c8520516fa3e9
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "process-title.h"
#include <stdlib.h> /* NetBSD, OpenBSD */
#include <unistd.h> /* FreeBSD */
static char *process_name = NULL;
#ifdef HAVE_SETPROCTITLE
#endif
#ifdef PROCTITLE_HACK
#define PROCTITLE_CLEAR_CHAR 0xab
static char *process_title;
{
char *last;
unsigned int i;
bool clear_env;
/* find the last argv or environment string. it should always be the
last string in environ, but don't rely on it. this is what openssh
does, so hopefully it's safe enough. */
}
}
process_title = argv[0];
/* if there are problems with this approach, try to make sure we
notice it */
if (clear_env) {
} else {
}
}
{
char **new_argv;
unsigned int i, count;
for (i = 0; i < count; i++) {
}
return new_argv;
}
static void proctitle_hack_set(const char *title)
{
if (len >= process_title_len)
if (len < process_title_clean_pos) {
} else if (process_title_clean_pos != 0) {
}
}
#endif
void process_title_init(char **argv[])
{
#ifdef PROCTITLE_HACK
extern char **environ;
char **orig_environ = environ;
#endif
process_name = (*argv)[0];
}
{
#ifdef HAVE_SETPROCTITLE
else
#elif defined(PROCTITLE_HACK)
#endif
}