summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-04-01 13:06:22 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-04-01 13:06:22 (GMT)
commitcd1131e118f9881677b328f05673bf3e90ba3dfb (patch)
treedf4ef4e61b83bd4dfb18467bf887bd93388dbf14
parentbbc3bb7823030f97cb3f96d7a76ccf49b0245545 (diff)
parente14e7323ec0a1a11668d5ae89f1e4a102e4757b4 (diff)
downloadtcl-cd1131e118f9881677b328f05673bf3e90ba3dfb.zip
tcl-cd1131e118f9881677b328f05673bf3e90ba3dfb.tar.gz
tcl-cd1131e118f9881677b328f05673bf3e90ba3dfb.tar.bz2
Imported fix for bug [97069ea11a] from branch bug-97069ea11a: empty error message on stalled background flush after async socket connect fail
-rw-r--r--generic/tclIO.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index ff975c3..790136c 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3270,7 +3270,17 @@ Tcl_Close(
Tcl_SetObjResult(interp,
Tcl_NewStringObj(Tcl_PosixError(interp), -1));
}
- flushcode = -1;
+ return TCL_ERROR;
+ }
+ /*
+ * Bug 97069ea11a: set error message if a flush code is set and no error
+ * message set up to now.
+ */
+ if (flushcode != 0 && interp != NULL
+ && 0 == Tcl_GetCharLength(Tcl_GetObjResult(interp)) ) {
+ Tcl_SetErrno(flushcode);
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(Tcl_PosixError(interp), -1));
}
if ((flushcode != 0) || (result != 0)) {
return TCL_ERROR;