Skip to content
Tcl Source Code History Of Ticket b58e6897034fc529
Login

History Of Ticket b58e6897034fc529

Artifacts Associated With Ticket b58e6897034fc529

  1. Ticket change [c372d923df] (rid 157182) by dram on 2017-10-19 10:55:18:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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
      
    5. is_private initialized to: "0"
    6. login: "dram"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Minor"
    10. status initialized to: "Open"
    11. submitter initialized to: "dram"
    12. subsystem initialized to: "- New Builtin Commands"
    13. title initialized to: "Return value of `Tcl_Flush`"
    14. type initialized to: "Bug"
  2. Ticket change [d17072f060] (rid 157221) by jan.nijtmans on 2017-10-23 12:11:09:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2458050.00774884"
    3. closer changed to: "jan.nijtmans"
    4. foundin changed to: "Tcl 8.6.7"
    5. 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!
      
    6. login: "jan.nijtmans"
    7. mimetype: "text/x-fossil-wiki"
    8. resolution changed to: "Fixed"
    9. status changed to: "Closed"
  3. Ticket change [ecb677d156] (rid 157324) by dram on 2017-10-25 07:32:21:

    1. closedate changed to: "2458051.81414132"
    2. closer changed to: "dram"
    3. icomment: "Fix confirmed, thanks."
    4. login: "dram"
    5. mimetype: "text/plain"