Răsfoiți Sursa

* No longer making the bot fatal() if it cannot open a new socket.

svn: 1688
Bryan Drewery 21 ani în urmă
părinte
comite
1ba1f132b1
2 a modificat fișierele cu 8 adăugiri și 5 ștergeri
  1. 1 0
      doc/UPDATES
  2. 7 5
      src/shell.c

+ 1 - 0
doc/UPDATES

@@ -44,6 +44,7 @@ This is a summary of ChangeLog basically.
 * Added cmd_iop which will invite the specified nick to a chan and then auto-op them upon joining (does a userhost)
 * Added hijacked invite detection based on server invite notices.
 * Added an action when a bot performs an invite, including username and full address.
+* No longer making the bot fatal() if it cannot open a new socket.
 
 1.2
 * No longer displaying SALTS on ./bin -v

+ 7 - 5
src/shell.c

@@ -111,13 +111,15 @@ void check_maxfiles()
 
   sock1 = getsock(0, AF_INET);		/* fill up any lower avail */
   sock = getsock(0, AF_INET);
-  
-  if (sock == -1)
-    fatal("Cannot create new socket.", 0);		/* this shouldnt happen */
-  else
-    killsock(sock);
+
   if (sock1 != -1)
     killsock(sock1);
+  
+  if (sock == -1) {
+    return;
+  } else
+    killsock(sock);
+
   bogus = sock - socks_total - 4;	//4 for stdin/stdout/stderr/dns 
  
   if (bogus >= 50) {			/* Attempt to close them */