summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;