[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: The Links/Links2/ELinks browsers are unusable on Debian GNU/Hurd

Fabienne Ducroquet <fabiduc@gmail.com> writes:

>     I've found that the function free_itrm is called later and it unsets
> these modes.

free_itrm should be called only if an error or EOF occurs in
terminal handling, or when ELinks is exiting.

> It is called by select_loop line 305 while i = 7 and n = 1.

I suppose you mean this part:

	if (FD_ISSET(i, &x_error)) {
		if (threads[i].error_func) {
		k = 1;

Looking at pty_io_select in hurd-20040508/term/ptyio.c, I see
that it sets avail |= SELECT_URG whenever the caller is
interested in that and control_byte is nonzero.  So, it appears
that ELinks interprets the presence of the tty in x_error as an
indication that an actual error has occurred, whereas the Hurd
would like to report benign TIOCPKT (packet_mode) or TIOCUCNTL
(user_ioctl_mode) related events that way.

Could pty_io_select perhaps be changed to report SELECT_URG only
if one of those modes is actually active?

Alternatively, ELinks could be changed to ignore exceptional
conditions that the select function returns for tty devices.
Specifically, all the uses of (select_handler_T) free_itrm as
the fourth argument of set_handlers would be changed to NULL.
However, I don't know the origin of that code, so I am wary of
changing it; it might be needed on some (perhaps non-POSIX) OS.
A Hurd-specific #ifdef would be doable though.

Attachment: pgpSOdXr1FEKb.pgp
Description: PGP signature

Reply to: