hostpid.c revision 9c50c41ab78887bccf775f8aed38059c92662dff
/* Copyright (c) 2002-2013 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "hostpid.h"
#include <stdlib.h>
#include <unistd.h>
#include <netdb.h>
#define HOSTNAME_DISALLOWED_CHARS "/\r\n\t"
const char *my_hostname = NULL;
static char *my_hostname_dup = NULL;
void hostpid_init(void)
{
static char pid[MAX_INT_STRLEN];
char hostname[256];
const char *value;
/* allow calling hostpid_init() multiple times to reset hostname */
i_fatal("gethostname() failed: %m");
}
if (value[0] == '\0' ||
}
void hostpid_deinit(void)
{
}
const char *my_hostdomain(void)
{
const char *name;
/* failed, use just the hostname */
name = my_hostname;
}
}
}
return my_domain;
}