main.c revision 02c335c23bf5fa225a467c19f2c063fb0dc7b8c3
/* Copyright (c) 2009-2016 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 <unistd.h>
struct connect_limit *connect_limit;
bool anvil_restarted;
static struct io *log_fdpass_io;
{
}
static void ATTR_NULL(1)
{
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();
log_fdpass_input, (void *)NULL);
if (log_fdpass_io != NULL)
return 0;
}