fixed renameAccount function (merging mode)
[NeonServV5.git] / src / signal.c
index d427ae2e9510884b927b02f4005899d2d37ede6d..bc444465089f1b2faa2f5d3ce03366c3ae3c041a 100644 (file)
@@ -1,4 +1,4 @@
-/* signal.c - NeonServ v5.5
+/* signal.c - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -87,20 +87,17 @@ static void sigcrash(int signum) {
     for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
         if((bot->flags & SOCKET_FLAG_CONNECTED)) {
             iohandler_close(bot->iofd);
-            bot->flags &= SOCKET_FLAG_CONNECTED;
+            bot->flags &= ~(SOCKET_FLAG_CONNECTED | SOCKET_FLAG_READY);
             bot->iofd = NULL;
         }
     }
     putlog(LOGLEVEL_INFO, "hard shutdown...\n");
-    exit_daemon();
     usleep(2000000);
     //hard restart
-    restart_process();
+    restart_bot(1);
     exit(0);
 }
 
 static void sigexit(int signum) {
-    cleanup();
-    exit_daemon();
-    exit(0);
+    stop_bot();
 }