diff options
Diffstat (limited to 'unix/tclUnixSock.c')
| -rw-r--r-- | unix/tclUnixSock.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index c94ee4e..dd8ca30 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -627,11 +627,12 @@ TcpOutputProc( static int TcpCloseProc( void *instanceData, /* The socket to close. */ - Tcl_Interp *interp) /* For error reporting */ + Tcl_Interp *dummy) /* For error reporting - unused */ { TcpState *statePtr = (TcpState *)instanceData; int errorCode = 0; TcpFdList *fds; + (void)dummy; /* * Delete a file handler that may be active for this socket if this is a @@ -665,9 +666,6 @@ TcpCloseProc( freeaddrinfo(statePtr->myaddrlist); } ckfree(statePtr); - if (interp && errorCode) { - Tcl_SetResult(interp, (char *)Tcl_PosixError(interp), TCL_STATIC); - } return errorCode; } @@ -691,19 +689,19 @@ TcpCloseProc( static int TcpClose2Proc( void *instanceData, /* The socket to close. */ - Tcl_Interp *interp, /* For error reporting. */ + Tcl_Interp *dummy, /* For error reporting. */ int flags) /* Flags that indicate which side to close. */ { TcpState *statePtr = (TcpState *)instanceData; int readError = 0; int writeError = 0; - int errorCode = 0; + (void)dummy; /* * Shutdown the OS socket handle. */ if ((flags & (TCL_CLOSE_READ|TCL_CLOSE_WRITE)) == 0) { - return TcpCloseProc(instanceData, interp); + return TcpCloseProc(instanceData, NULL); } if ((flags & TCL_CLOSE_READ) && (shutdown(statePtr->fds.fd, SHUT_RD) < 0)) { readError = errno; @@ -711,12 +709,7 @@ TcpClose2Proc( if ((flags & TCL_CLOSE_WRITE) && (shutdown(statePtr->fds.fd, SHUT_WR) < 0)) { writeError = errno; } - - errorCode = (readError != 0) ? readError : writeError; - if (interp && errorCode) { - Tcl_SetResult(interp, (char *)Tcl_PosixError(interp), TCL_STATIC); - } - return errorCode; + return (readError != 0) ? readError : writeError; } /* |
