diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-01-30 13:54:51 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-01-30 13:54:51 (GMT) |
| commit | 7fa698c624cc7b55551ddd45cae110a04f0582b1 (patch) | |
| tree | 6d7ba1ff65e8ae035abc04a795e51824123852f0 /unix/tclUnixSock.c | |
| parent | 29b9dd2e6f727b0e941ebfb7137545d235f5d7ea (diff) | |
| parent | c8c1298bb3b2b00caa2f412fd6947abd471e2891 (diff) | |
| download | tcl-7fa698c624cc7b55551ddd45cae110a04f0582b1.zip tcl-7fa698c624cc7b55551ddd45cae110a04f0582b1.tar.gz tcl-7fa698c624cc7b55551ddd45cae110a04f0582b1.tar.bz2 | |
Merge 8.7
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 fcb508d..29defff 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -687,7 +687,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. @@ -696,12 +697,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; } /* |
