hostpid.c revision a8aec60b5359e5ea7fc7a9464217ae3626df8785
/* 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;
void hostpid_init(void)
{
if (my_hostname == NULL) {
i_fatal("gethostname() failed: %m");
}
if (my_hostname[0] == '\0' ||
/* allow calling hostpid_init() multiple times to reset hostname */
}
void hostpid_deinit(void)
{
}
const char *my_hostdomain(void)
{
const char *name;
/* failed, use just the hostname */
name = my_hostname;
}
}
}
return my_domain;
}