#include <string.h>
#include <time.h>
#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
#include <signal.h>
+#include <unistd.h>
void initseed();
void init_logfile();
init_logfile();
- initsstring();
-
if (argc>1) {
if (strcmp(argv[1], "--help")==0) {
printf("Syntax: %s [config]\n", argv[0]);
initconfig(config);
+ /* modules can rely on this directory always being there */
+ if (mkdir("data", 0700) < 0 && errno != EEXIST) {
+ perror("mkdir");
+ return 1;
+ }
+
/* Loading the modules will bring in the bulk of the code */
initmodules();
+ signal(SIGPIPE, SIG_IGN);
signal(SIGINT, siginthandler);
signal(SIGUSR1, sigusr1handler);
signal(SIGHUP, sighuphandler);
}
freeconfig();
- finisstring();
fini_logfile();
finischedule();