summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b34544b)
return -1;
if (as > bs)
return +1;
return -1;
if (as > bs)
return +1;
+ if (a < b)
+ return -1;
+ if (a > b)
+ return +1;
short localport;
int fl, salen;
short localport;
int fl, salen;
+ /*
+ * Remove the socket from the tree before we overwrite its
+ * internal socket id, because that forms part of the tree's
+ * sorting criterion. We'll add it back before exiting this
+ * function, whether we changed anything or not.
+ */
+ del234(sktree, sock);
+
if (sock->s >= 0)
close(sock->s);
if (sock->s >= 0)
close(sock->s);
+
+ /*
+ * No matter what happened, put the socket back in the tree.
+ */
+ add234(sktree, sock);
+
if (err)
plug_log(sock->plug, 1, sock->addr, sock->port, strerror(err), err);
return err;
if (err)
plug_log(sock->plug, 1, sock->addr, sock->port, strerror(err), err);
return err;