]> jfr.im git - irc/quakenet/newserv.git/blobdiff - core/main.c
nickwatch: Add hook for HOOK_NICK_ACCOUNT.
[irc/quakenet/newserv.git] / core / main.c
index ff5728d4053cbfdad5d7854f527460d76743fef1..dfbd7dfe234c366800d6edd1b20cc26e48870219 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();
@@ -41,8 +45,6 @@ int main(int argc, char **argv) {
 
   init_logfile();
   
-  initsstring();
-  
   if (argc>1) {
     if (strcmp(argv[1], "--help")==0) {
       printf("Syntax: %s [config]\n", argv[0]);
@@ -57,6 +59,12 @@ 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(SIGINT, siginthandler);
@@ -78,7 +86,6 @@ int main(int argc, char **argv) {
   }  
 
   freeconfig();
-  finisstring();  
 
   fini_logfile();
   finischedule();