Artifacts Associated With Ticket b58e6897034fc529
Ticket change [c372d923df] (rid 157182) by dram on 2017-10-19 10:55:18:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
It seems that return value description of `Tcl_Flush` in document[1] is not consistent with the implementation, it says result will be `TCL_OK` or `TCL_ERROR`, but sometimes `-1` is returned. e.g.: ``` #include <tcl.h> int main() { Tcl_Interp *interp = Tcl_CreateInterp(); Tcl_Channel channel = Tcl_GetStdChannel(TCL_STDIN); printf("TCL_OK = %d\n", TCL_OK); printf("TCL_ERROR = %d\n", TCL_ERROR); printf("Tcl_Flush(stdin) = %d\n", Tcl_Flush(channel)); Tcl_DeleteInterp(interp); return 0; } ``` Output: ``` TCL_OK = 0 TCL_ERROR = 1 Tcl_Flush(stdin) = -1 ``` [1] https://tcl.tk/man/tcl8.6/TclLib/OpenFileChnl.htm#M19 - is_private initialized to: "0"
- login: "dram"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "dram"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to: "Return value of `Tcl_Flush`"
- type initialized to: "Bug"
Ticket change [d17072f060] (rid 157221) by jan.nijtmans on 2017-10-23 12:11:09:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2458050.00774884"
- closer changed to: "jan.nijtmans"
- foundin changed to: "Tcl 8.6.7"
- icomment:
Good catch! In this case there is no reason to distingish the channel being non-writable with other errors, since the actual error situation is expected to be returned in errno anyway in both cases. It looks like an ancient copy/paste error, since a lot of other functions where CheckChannelErrors() is used return -1 for error. Therefore: agreed with the analyses. Should be fixed now in core-8-6-branch and trunk. Thanks!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [ecb677d156] (rid 157324) by dram on 2017-10-25 07:32:21:
- closedate changed to: "2458051.81414132"
- closer changed to: "dram"
- icomment: "Fix confirmed, thanks."
- login: "dram"
- mimetype: "text/plain"