Просмотр исходного кода

* Fixed bots quitting on max files with the getpid stuff, it's the WRONG error to quit with

svn: 1378
Bryan Drewery 21 лет назад
Родитель
Сommit
64226b1d23
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      src/shell.c

+ 6 - 1
src/shell.c

@@ -106,7 +106,12 @@ int clear_tmp()
 #ifdef LEAF
 void check_mypid()
 { 
-  if (can_stat(conf.bot->pid_file) && (getpid() != checkpid(conf.bot->nick, NULL)))
+  pid_t pid = 0;
+  
+  if (can_stat(conf.bot->pid_file))
+    pid = checkpid(conf.bot->nick, NULL);
+
+  if (pid && (pid != getpid()))
     fatal(STR("getpid() does not match pid in file. Possible cloned process, exiting.."), 0);
 }
 #endif /* LEAF */