main.c revision c7556e6ae179d63a2e6ad6d912622848c986f316
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "lib-signals.h"
#include "rawlog.h"
#include "restrict-access.h"
#include "fd-close-on-exec.h"
#include "process-title.h"
#include <stdlib.h>
#include <syslog.h>
static char log_prefix[64];
{
}
static void main_init(int use_syslog)
{
i_fatal("USER environment missing");
/* log failures into specified log file */
} else if (use_syslog) {
/* prefix with imapd(user) */
}
/* do the chrooting etc. */
clients_init();
/* support also maildir-specific environment */
}
/* failed */
else {
const char *home;
i_fatal("MAIL environment missing and "
"autodetection failed (home %s)", home);
}
}
} else {
}
}
static void main_deinit(void)
{
/* warn about being killed because of some signal, except SIGINT (^C)
which is too common at least while testing :) */
closelog();
}
{
#ifdef DEBUG
#endif
/* NOTE: we start rooted, so keep the code minimal until
restrict_access_by_env() is called */
lib_init();
main_deinit();
lib_deinit();
return 0;
}