From 571cec9ea62ec5efe56305e888aaef60fe0c6eeb Mon Sep 17 00:00:00 2001 From: stanton Date: Tue, 9 Jun 1998 13:09:02 +0000 Subject: changed so server sockets can't be trashed by fileevent --- unix/tclUnixChan.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index c194b66..28e62e5 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -1769,12 +1769,20 @@ TcpWatchProc(instanceData, mask) { TcpState *statePtr = (TcpState *) instanceData; - if (mask) { - Tcl_CreateFileHandler(statePtr->fd, mask, - (Tcl_FileProc *) Tcl_NotifyChannel, - (ClientData) statePtr->channel); - } else { - Tcl_DeleteFileHandler(statePtr->fd); + /* + * Make sure we don't mess with server sockets since they will never + * be readable or writable at the Tcl level. This keeps Tcl scripts + * from interfering with the -accept behavior. + */ + + if (!statePtr->acceptProc) { + if (mask) { + Tcl_CreateFileHandler(statePtr->fd, mask, + (Tcl_FileProc *) Tcl_NotifyChannel, + (ClientData) statePtr->channel); + } else { + Tcl_DeleteFileHandler(statePtr->fd); + } } } -- cgit v0.12