Explorar el Código

* conf_checkpids() was needed before a few spawnbots()

svn: 2262
Bryan Drewery hace 21 años
padre
commit
ba1b76a6ce
Se han modificado 3 ficheros con 6 adiciones y 5 borrados
  1. 3 3
      src/binary.c
  2. 1 1
      src/binary.h
  3. 2 1
      src/cmds.c

+ 3 - 3
src/binary.c

@@ -468,13 +468,12 @@ clear_settings(void)
   egg_memset(&settings.bots, 0, SIZE_CONF);
 }
 
-void conf_to_bin(conf_t *in, bool move, int die, bool clear)
+void conf_to_bin(conf_t *in, bool move, int die)
 {
   conf_bot *bot = NULL;
   char *newbin = NULL;
 
-  if (clear)
-    clear_settings();
+  clear_settings();
   sdprintf("converting conf to bin\n");
   simple_sprintf(settings.uid, "%d", in->uid);
   simple_sprintf(settings.watcher, "%d", in->watcher);
@@ -541,6 +540,7 @@ void reload_bin_data() {
       /* add any bots not in userfile */
       conf_add_userlist_bots();
       /* start/disable new bots as necesary */
+      conf_checkpids();
       spawnbots(1);		//1 signifies to not start me!
     } else
       free_conf_bots(conf.bots);

+ 1 - 1
src/binary.h

@@ -13,6 +13,6 @@ extern int checked_bin_buf;
 
 void check_sum(const char *, const char *);
 void write_settings(const char *, int, bool);
-void conf_to_bin(conf_t *, bool, int, bool clear = 1);
+void conf_to_bin(conf_t *, bool, int);
 void reload_bin_data();
 #endif /* !_BINARY_H */

+ 2 - 1
src/cmds.c

@@ -1726,10 +1726,11 @@ static void cmd_conf(int idx, char *par)
 
   if (save) {
     /* rewrite our binary */
-    conf_to_bin(&conf, 0, -1, 0);
+    conf_to_bin(&conf, 0, -1);
 
     kill_removed_bots(oldlist, conf.bots);
     conf_add_userlist_bots();
+    conf_checkpids();
     spawnbots(1);
   }