Procházet zdrojové kódy

* Port [3192] to 1.2.14
* Fix bots being removed from binary not being killed. (fixes #338)



svn: 3193

Bryan Drewery před 19 roky
rodič
revize
05e59a0c9a
2 změnil soubory, kde provedl 5 přidání a 3 odebrání
  1. 1 0
      doc/UPDATES
  2. 4 3
      src/conf.c

+ 1 - 0
doc/UPDATES

@@ -7,6 +7,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fix bug with bots not retaining flags over share. (fixes #334)
 * Remove the notes system and related commands. (fixes #275)
 * Fix ./binary -C not signalling the correct process under some situations. (actually fixes #315)
+* Fix bots being removed from binary not being killed. (fixes #338)
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 4 - 3
src/conf.c

@@ -196,7 +196,7 @@ confedit()
   char *editor = NULL;
   mode_t um;
   int waiter;
-  pid_t pid, xpid, localhub_pid = 0;
+  pid_t pid, xpid;
   struct stat st, sn;
   struct timespec ts1, ts2;           /* time before and after edit */
   bool autowrote = 0;
@@ -331,8 +331,8 @@ confedit()
 
   /* Lookup the pid now in case it changed while in the editor */
   if (localhub) {
-    localhub->pid = localhub_pid = checkpid(localhub->nick, localhub, NULL);
-    kill(localhub_pid, SIGUSR1);
+    localhub->pid = checkpid(localhub->nick, localhub, NULL);
+    kill(localhub->pid, SIGUSR1);
   }
 
   exit(0);
@@ -1048,6 +1048,7 @@ void kill_removed_bots(conf_bot *oldlist, conf_bot *newlist)
         }
       }
       if (!found) {
+        botold->pid = checkpid(botold->nick, botold, NULL);
         conf_killbot(NULL, botold, SIGKILL);
         if ((u = get_user_by_handle(userlist, botold->nick))) {
           putlog(LOG_MISC, "*", "Removing '%s' as it has been removed from the binary config.", botold->nick);