Răsfoiți Sursa

* Signal child leaf bots to reread the binary (new hubs) when writing userfile

Bryan Drewery 14 ani în urmă
părinte
comite
89092fcccf
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      src/conf.c

+ 6 - 0
src/conf.c

@@ -1044,6 +1044,12 @@ void conf_update_hubs(struct userrec* list) {
   if (conf.bot->hub || conf.bot->localhub) {
     /* rewrite our binary */
     conf_to_bin(&conf, 0, -1);
+
+    /* Now signal all of the old bots with SIGUSR1
+     * They will auto die and determine new localhub, etc..
+     */
+    conf_checkpids(conf.bots);
+    conf_killbot(conf.bots, conf.bot->nick, NULL, SIGUSR1, 1); /* Don't kill me. */
   }
 }