diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2014-04-01 11:31:49 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2014-04-01 11:31:49 (GMT) |
commit | e14e7323ec0a1a11668d5ae89f1e4a102e4757b4 (patch) | |
tree | 9761eb95073c5ea31d296291aa702f6744c3b1e0 | |
parent | 228bbc8713a27f21735f74e4ed4a4e77c8edf3c7 (diff) | |
download | tcl-e14e7323ec0a1a11668d5ae89f1e4a102e4757b4.zip tcl-e14e7323ec0a1a11668d5ae89f1e4a102e4757b4.tar.gz tcl-e14e7323ec0a1a11668d5ae89f1e4a102e4757b4.tar.bz2 |
Fix test failure socket-2.9: "1 {not owner}" instead of "1 {couldn't open socket address already in use}" by only setting returned error message if not jet set.
-rw-r--r-- | generic/tclIO.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 15fc8af..9e675c6 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -3211,18 +3211,17 @@ Tcl_Close( } return TCL_ERROR; } - if (result != 0) { - return TCL_ERROR; - } /* - * Bug 97069ea11a: set error message if a flush code is set + * Bug 97069ea11a: set error message if a flush code is set and no error + * message set up to now. */ - if (flushcode != 0) { + if (flushcode != 0 && interp != NULL + && 0 == Tcl_GetCharLength(Tcl_GetObjResult(interp)) ) { Tcl_SetErrno(flushcode); - if (interp != NULL) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj(Tcl_PosixError(interp), -1)); - } + Tcl_SetObjResult(interp, + Tcl_NewStringObj(Tcl_PosixError(interp), -1)); + } + if ((flushcode != 0) || (result != 0)) { return TCL_ERROR; } return TCL_OK; |