summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-04-04 08:55:16 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-04-04 08:55:16 (GMT)
commit83674895910aaf2ff10fd52075b53e39020d8568 (patch)
treedb2b2f1f82226163a6c425014e05affd8757c914
parent1007034bc363be609efa893cb0283dcb8187fb96 (diff)
parent3789b7493dc4baf577d118984bde1ea11cbe66e5 (diff)
downloadtcl-83674895910aaf2ff10fd52075b53e39020d8568.zip
tcl-83674895910aaf2ff10fd52075b53e39020d8568.tar.gz
tcl-83674895910aaf2ff10fd52075b53e39020d8568.tar.bz2
Fix for Bug [97069ea11a]: Set return message in close if a flush error is reported (which may be an error from a background flush)
-rw-r--r--generic/tclIO.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index c43e61e..9e675c6 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3209,7 +3209,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;