summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-04-01 09:52:34 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-04-01 09:52:34 (GMT)
commit228bbc8713a27f21735f74e4ed4a4e77c8edf3c7 (patch)
treedc8a8df34018ceb93366727fc277fec7530433cd /generic/tclIO.c
parentc85fe58264794439fe6057b5d98428a033774bcc (diff)
downloadtcl-228bbc8713a27f21735f74e4ed4a4e77c8edf3c7.zip
tcl-228bbc8713a27f21735f74e4ed4a4e77c8edf3c7.tar.gz
tcl-228bbc8713a27f21735f74e4ed4a4e77c8edf3c7.tar.bz2
Set return message in close if a flush error is reported (which may be an error from a background flush). Ticket [97069ea11a]
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index c43e61e..15fc8af 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3209,9 +3209,20 @@ Tcl_Close(
Tcl_SetObjResult(interp,
Tcl_NewStringObj(Tcl_PosixError(interp), -1));
}
- flushcode = -1;
+ return TCL_ERROR;
}
- if ((flushcode != 0) || (result != 0)) {
+ if (result != 0) {
+ return TCL_ERROR;
+ }
+ /*
+ * Bug 97069ea11a: set error message if a flush code is set
+ */
+ if (flushcode != 0) {
+ Tcl_SetErrno(flushcode);
+ if (interp != NULL) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(Tcl_PosixError(interp), -1));
+ }
return TCL_ERROR;
}
return TCL_OK;