From d8ec9c1962781851bb16aa443e24f8532c69f6f2 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 12 May 2012 01:28:46 -0400 Subject: [PATCH] remove any pending selects when closing the socket. --- mdetach.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mdetach.c b/mdetach.c index 956e7ea..7b13342 100644 --- a/mdetach.c +++ b/mdetach.c @@ -17,6 +17,10 @@ int mdetach(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5) IncBusy(); TCPIPCloseTCP(e->ipid); + // hmmm this is in the close() call, so the + // fd won't be valid afterwards.... + e->select_rd_pid = 0xffff; + e->select_wr_pid = 0xffff; e->command = kCommandDisconnectAndLogout; e->cookie = 0; e->timeout = timeout;