summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixSock.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-30 13:54:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-30 13:54:01 (GMT)
commitc8c1298bb3b2b00caa2f412fd6947abd471e2891 (patch)
treeb6c2f7d64044d4088ef64be9d2c09e79fe5ddbeb /unix/tclUnixSock.c
parent64fdac4aec06a54d95bb8916c7a8e3cebf2cde20 (diff)
parentf58b90fb022b744619f4a7af445bac8a561bde7a (diff)
downloadtcl-c8c1298bb3b2b00caa2f412fd6947abd471e2891.zip
tcl-c8c1298bb3b2b00caa2f412fd6947abd471e2891.tar.gz
tcl-c8c1298bb3b2b00caa2f412fd6947abd471e2891.tar.bz2
Merge 8.6
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r--unix/tclUnixSock.c11
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;
}
/*