Przeglądaj źródła

* Remove more old and unused code

Bryan Drewery 17 lat temu
rodzic
commit
6d1b86eb07
5 zmienionych plików z 0 dodań i 111 usunięć
  1. 0 20
      src/binary.c
  2. 0 30
      src/crypt.c
  3. 0 18
      src/main.c
  4. 0 7
      src/mod/irc.mod/chan.c
  5. 0 36
      src/shell.c

+ 0 - 20
src/binary.c

@@ -677,26 +677,6 @@ void reload_bin_data() {
        /* deluser removed bots from conf */
       if (oldbots)
         deluser_removed_bots(oldbots, conf.bots);
-#ifdef this_is_handled_by_confedit_now
-      /* no longer the localhub (or removed), need to alert the new one to rehash (or start it) */
-      if (!conf.bot || !conf.bot->localhub) {
-        conf_bot *localhub = conf_getlocalhub(conf.bots);
-
-        /* then SIGHUP new localhub or spawn new localhub */
-        if (localhub) {
-          /* Check for pid again - may be using fork-interval */
-          localhub->pid = checkpid(localhub->nick, localhub);
-          if (localhub->pid)
-            conf_killbot(NULL, localhub, SIGHUP);		//restart the new localhub
-          /* else
-               start new localhub - done below in spawnbots() */
-        }
-      }
-
-      /* start/disable new bots as necesary */
-      conf_checkpids(conf.bots);
-      spawnbots(1);		//1 signifies to not start me!
-#endif
     }
 
     if (conf.bot && conf.bot->disabled) {

+ 0 - 30
src/crypt.c

@@ -417,33 +417,3 @@ char *btoh(const unsigned char *md, size_t len)
   ret = buf;
   return ret;
 }
-#ifdef k
-void do_crypt_console()
-{
-  char inbuf[1024] = "";
-  int which = 5;
-  char *p = NULL;
-
-  printf("Crypt menu:\n");
-  printf("-----------\n");
-  printf("1) String\n");
-  printf("2) File\n");
-
-  printf("1) MD5\n");
-  printf("2) SHA1\n");
-  printf("3) AES256 (binary)\n");
-  printf("4) AES256+base64\n");
-  printf("5) exit\n");
-  printf("\n");
-  printf("[5]: ");
-
-  fgets(inbuf, sizeof(inbuf), stdin);
-  if ((p = strchr(inbuf, '\n')))
-    *p = 0;
-
-  which = atoi(inbuf);
-
-  switch (which) {
-    case 
-}
-#endif

+ 0 - 18
src/main.c

@@ -513,9 +513,6 @@ static void core_secondly()
   static int cnt = 0, ison_cnt = 0;
   time_t miltime;
 
-#ifdef CRAZY_TRACE 
-  if (!attached) crazy_trace();
-#endif /* CRAZY_TRACE */
   if (fork_interval && backgrd && ((now - lastfork) > fork_interval))
       do_fork();
   ++cnt;
@@ -862,25 +859,10 @@ printf("out: %s\n", out);
       mypid = do_fork();
   conf_setmypid(mypid);
 
-/*
-    printf("  |- %-10s (%d)\n", conf.bot->nick, pid);
-    if (conf.bot->localhub) {
-      if (bots_ran)
-        printf("  `- %d bots launched\n", bots_ran + 1);
-      else
-        printf("  `- 1 bot launched\n");
-    }
-*/
     printf(STR("%s[%s%s%s]%s -%s- initiated %s(%s%d%s)%s\n"),
            BOLD(-1), BOLD_END(-1), settings.packname, BOLD(-1), BOLD_END(-1), conf.bot->nick,
            BOLD(-1), BOLD_END(-1), mypid, BOLD(-1), BOLD_END(-1));
 
-#ifdef lame	/* keeping for god knows why */
-    printf(STR("%s%s%c%s%s%s l%sA%su%sN%sc%sH%se%sD%s %s(%s%d%s)%s\n"),
-            RED(-1), BOLD(-1), conf.bot->nick[0], BOLD_END(-1), &conf.bot->nick[1],
-            COLOR_END(-1), BOLD(-1), BOLD_END(-1), BOLD(-1), BOLD_END(-1), BOLD(-1), BOLD_END(-1),
-            BOLD(-1), BOLD_END(-1), YELLOW(-1), COLOR_END(-1), mypid, YELLOW(-1), COLOR_END(-1));
-#endif
     } else
       writepid(conf.bot->pid_file, mypid);
     close_tty();

+ 0 - 7
src/mod/irc.mod/chan.c

@@ -1761,13 +1761,6 @@ static int got352or4(struct chanset_t *chan, char *user, char *host, char *nick,
 //    strcpy(botuserhost, m->userhost);		/* Yes, save my own userhost */
     m->joined = now;				/* set this to keep the whining masses happy */
   }
-#ifdef do_this_at_end_of_who
-    if (!waschanop && me_op(chan))
-      recheck_channel(chan, 2);
-    if (!me_op(chan) && any_ops(chan))
-      chan->channel.do_opreq = 1;
-  }
-#endif
 
   if (!m->user && !m->tried_getuser) {
     m->user = get_user_by_host(userhost);

+ 0 - 36
src/shell.c

@@ -996,42 +996,6 @@ void crontab_create(int interval) {
 }
 #endif /* !CYGWIN_HACKS */
 
-#ifdef CRAZY_TRACE
-/* This code will attach a ptrace() to getpid() hence blocking process hijackers/tracers on the pid
- * only problem.. it just creates a new pid to be traced/hijacked :\
- */
-int attached = 0;
-void crazy_trace()
-{
-  pid_t parent = getpid();
-  int x = fork();
-
-  if (x == -1) {
-    printf("Can't fork(): %s\n", strerror(errno));
-  } else if (x == 0) {
-    /* child */
-    int i;
-    i = ptrace(PTRACE_ATTACH, parent, (char *) 1, 0);
-    if (i == -1) {
-      printf("CANT PTRACE PARENT: errno: %d %s, i: %d\n", errno, strerror(errno), i);
-      waitpid(parent, &i, 0);
-      kill(parent, SIGCHLD);
-      ptrace(PTRACE_DETACH, parent, 0, 0);
-      kill(parent, SIGCHLD);
-      exit(0);
-    } else {
-      printf("SUCCESSFUL ATTACH to %d: %d\n", parent, i);
-      attached++;
-    }
-  } else {
-    /* parent */
-    printf("wait()\n");
-    wait(&x);
-  }
-  printf("end\n");
-}
-#endif /* CRAZY_TRACE */
-
 int det_translate(const char *word)
 {
   if (word && word[0]) {