view src/lib/hostpid.h @ 19604:c996bc091c6b

master: Do not close stdout if going foreground This lets one to use /dev/stdout for logging. Mainly useful for testing purposes where we can generate log output to stdout and use tee to write it to a file for later examination.
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Mon, 18 Jan 2016 15:50:23 +0200
parents a6b40687c0a4
children
line wrap: on
line source

#ifndef HOSTPID_H
#define HOSTPID_H

/* These environments override the hostname/hostdomain if they're set.
   Master process normally sets these to child processes. */
#define MY_HOSTNAME_ENV "DOVECOT_HOSTNAME"
#define MY_HOSTDOMAIN_ENV "DOVECOT_HOSTDOMAIN"

extern const char *my_hostname;
extern const char *my_pid;

/* Initializes my_hostname and my_pid. */
void hostpid_init(void);
void hostpid_deinit(void);

/* Returns the current host+domain, or if it fails fallback to returning
   hostname. */
const char *my_hostdomain(void);

#endif