main.c revision 5f5870385cff47efd2f58e7892f251cf13761528
/* Copyright (c) 2009-2012 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "array.h"
#include "env-util.h"
#include "fdpass.h"
#include "ioloop.h"
#include "restrict-access.h"
#include "master-service.h"
#include "master-service-settings.h"
#include "master-interface.h"
#include "connect-limit.h"
#include "penalty.h"
#include "anvil-connection.h"
#include <stdlib.h>
#include <unistd.h>
struct connect_limit *connect_limit;
bool anvil_restarted;
static struct io *log_fdpass_io;
{
}
{
int fd;
char c;
/* master wants us to replace the log fd */
if (ret < 0)
i_error("fd_read(log fd) failed: %m");
else if (ret == 0) {
/* master died. lib-master should notice it soon. */
} else {
i_fatal("dup2(fd_read log fd, stderr) failed: %m");
i_error("close(fd_read log fd) failed: %m");
}
}
{
const enum master_service_flags service_flags =
const char *error;
if (master_getopt(master_service) > 0)
return FATAL_DEFAULT;
/* delay dying until all of our clients are gone */
penalty = penalty_init();
if (log_fdpass_io != NULL)
return 0;
}