diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-01-30 13:54:01 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-01-30 13:54:01 (GMT) |
commit | c8c1298bb3b2b00caa2f412fd6947abd471e2891 (patch) | |
tree | b6c2f7d64044d4088ef64be9d2c09e79fe5ddbeb /unix/tclUnixSock.c | |
parent | 64fdac4aec06a54d95bb8916c7a8e3cebf2cde20 (diff) | |
parent | f58b90fb022b744619f4a7af445bac8a561bde7a (diff) | |
download | tcl-c8c1298bb3b2b00caa2f412fd6947abd471e2891.zip tcl-c8c1298bb3b2b00caa2f412fd6947abd471e2891.tar.gz tcl-c8c1298bb3b2b00caa2f412fd6947abd471e2891.tar.bz2 |
Merge 8.6
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r-- | unix/tclUnixSock.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 5f80435..57735da 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -686,7 +686,8 @@ TcpClose2Proc( int flags) /* Flags that indicate which side to close. */ { TcpState *statePtr = instanceData; - int errorCode = 0; + int readError = 0; + int writeError = 0; /* * Shutdown the OS socket handle. @@ -695,12 +696,12 @@ TcpClose2Proc( return TcpCloseProc(instanceData, interp); } if ((flags & TCL_CLOSE_READ) && (shutdown(statePtr->fds.fd, SHUT_RD) < 0)) { - errorCode = errno; + readError = errno; } - if ((flags & TCL_CLOSE_WRITE) && (shutdown(statePtr->fds.fd, SHUT_WR) < 0) && (errorCode != 0)) { - errorCode = errno; + if ((flags & TCL_CLOSE_WRITE) && (shutdown(statePtr->fds.fd, SHUT_WR) < 0)) { + writeError = errno; } - return errorCode; + return (readError != 0) ? readError : writeError; } /* |