• src/conio/curs_cio.c

    From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Mar 18 21:52:28 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/317f26995eb17ffa4bde55a1
    Modified Files:
    src/conio/curs_cio.c
    Log Message:
    Fix curses CPU spin when PTY is deleted (ticket #216)

    When a ttyd/SSH session drops and the PTY is deleted, ioctl(FIONREAD)
    returns -1/EIO instead of 0. The EOF detection in curs_getch() only
    checked for ioctl()==0, so the EIO case was missed and the while(get_wch()==ERR) loop spun at ~100% CPU. Treat FIONREAD failure
    as a dead fd and return CIO_KEY_QUIT immediately.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)