Bryan Drewery hace 15 años
padre
commit
e27bbcdf25
Se han modificado 2 ficheros con 4 adiciones y 4 borrados
  1. 1 1
      src/botcmd.c
  2. 3 3
      src/shell.c

+ 1 - 1
src/botcmd.c

@@ -1381,7 +1381,7 @@ static void bot_suicide(char* botnick, char* code, char* msg)
       break;
     }
   }
-  
+
   if (!valid_source) {
     putlog(LOG_WARN, "*", STR("AN INVALID BOT (%s) JUST SENT ME A SUICIDE REQUEST!"), botnick);
     return;

+ 3 - 3
src/shell.c

@@ -511,12 +511,12 @@ void suicide(const char *msg)
     //im the localhub, loop thru bots and kill 'em
     putlog(LOG_WARN, "*", STR("Comitting suicide: %s"), msg);
     crontab_del();
-    
+
     conf_bot *bot = NULL;
     for (bot = conf.bots; bot && bot->nick; bot = bot->next) {
-      bot->pid = checkpid(bot->nick, bot);
-      if (!strcmp(conf.bot->nick,bot->nick))
+      if (!strcmp(conf.bot->nick, bot->nick))
         continue; //skip myself or i wont be able to remove the rest
+      bot->pid = checkpid(bot->nick, bot);
       conf_killbot(conf.bots, NULL, bot, SIGKILL);
       unlink(bot->pid_file);
       deluser(bot->nick);