Revert the accidental commit to list.c, and commit the correct file (s_bsd.c).
authorMichael Poole <mdpoole@troilus.org>
Mon, 4 Jan 2010 00:37:28 +0000 (00:37 +0000)
committerMichael Poole <mdpoole@troilus.org>
Mon, 4 Jan 2010 00:37:28 +0000 (00:37 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1932 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ircd/list.c
ircd/s_bsd.c

index f6a11328ffedbc84b6f3f4a65309aa77b6bd9c15..d304e162d6ac5875f91750db5f6ac036a268b006 100644 (file)
@@ -427,9 +427,6 @@ void verify_client_list(void)
  */
 struct SLink* make_link(void)
 {
-#if 1
-  struct SLink* lp = (struct SLink*) MyMalloc(sizeof(struct SLink));
-#else
   struct SLink* lp = slinkFreeList;
   if (lp)
     slinkFreeList = lp->next;
@@ -437,7 +434,6 @@ struct SLink* make_link(void)
     lp = (struct SLink*) MyMalloc(sizeof(struct SLink));
     links.alloc++;
   }
-#endif
   assert(0 != lp);
   links.inuse++;
   memset(lp, 0, sizeof(*lp));
@@ -450,12 +446,8 @@ struct SLink* make_link(void)
 void free_link(struct SLink* lp)
 {
   if (lp) {
-#if 1
-    MyFree(lp);
-#else
     lp->next = slinkFreeList;
     slinkFreeList = lp;
-#endif
     links.inuse--;
   }
 }
index 63e9081c51da376193f3a01b9884c8e76b2da4be..2d8fb5ba39594cbe85f399c2d31a853a9fbe9224 100644 (file)
@@ -862,6 +862,11 @@ static void client_sock_callback(struct Event* ev)
   case ET_ERROR: /* an error occurred */
     fallback = cli_info(cptr);
     cli_error(cptr) = ev_data(ev);
+    /* If the OS told us we have a bad file descriptor, we should
+     * record that for future reference.
+     */
+    if (cli_error(cptr) == EBADF)
+      cli_fd(cptr) = -1;
     if (s_state(&(con_socket(con))) == SS_CONNECTING) {
       completed_connection(cptr);
       /* for some reason, the os_get_sockerr() in completed_connect()