summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2023-03-06 18:17:19 (GMT)
committerdgp <dgp@users.sourceforge.net>2023-03-06 18:17:19 (GMT)
commit5e095a3a4d445694e0a618ed20fe92d8fd34b637 (patch)
tree6281d7bdb38e515db1a4ab0f88c88cc3e911c447
parentcfa443421bcf235f75def81bc137774aa0f20387 (diff)
downloadtcl-5e095a3a4d445694e0a618ed20fe92d8fd34b637.zip
tcl-5e095a3a4d445694e0a618ed20fe92d8fd34b637.tar.gz
tcl-5e095a3a4d445694e0a618ed20fe92d8fd34b637.tar.bz2
[b4af93cd9f] Proposed fix from apnadkarni. It works!
-rw-r--r--unix/tclUnixSock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 70dfc61..0be10ad 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -1033,10 +1033,10 @@ TcpGetOptionProc(
if ((len == 0) || ((len > 1) && (optionName[1] == 'k') &&
(strncmp(optionName, "-keepalive", len) == 0))) {
+ int opt = 0;
#if defined(SO_KEEPALIVE)
- socklen_t size;
+ socklen_t size = sizeof(opt);
#endif
- int opt = 0;
if (len == 0) {
Tcl_DStringAppendElement(dsPtr, "-keepalive");
@@ -1053,10 +1053,10 @@ TcpGetOptionProc(
if ((len == 0) || ((len > 1) && (optionName[1] == 'n') &&
(strncmp(optionName, "-nodelay", len) == 0))) {
+ int opt = 0;
#if defined(SOL_TCP) && defined(TCP_NODELAY)
- socklen_t size;
+ socklen_t size = sizeof(opt);
#endif
- int opt = 0;
if (len == 0) {
Tcl_DStringAppendElement(dsPtr, "-nodelay");