]> jfr.im git - irc/quakenet/newserv.git/blobdiff - core/main.c
HELPMOD2: don't ignore +h clients
[irc/quakenet/newserv.git] / core / main.c
index d2b9ec53a25751b7d1f0623bb2cdad5dd010ddd1..a9adc188bc0dad1cb0ccd34ed7d23a2b3c81b0e2 100644 (file)
 #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();
@@ -55,8 +59,15 @@ int main(int argc, char **argv) {
 
   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);