Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 1996 19:24:22 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        joerg_wunsch@uriah.heep.sax.de, mbarkah@hemi.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: bug in 2.2-alpha loopback (?)
Message-ID:  <199612080824.TAA19537@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> I can't reproduce this with your test program:
>> 
>> j@uriah 1455% ./bar
>> Waiting for client on port 2000
>> Attention, read() returned 0.
>
>Sorry, I wasn't very careful considering all the variables. This
>might be a "telnet" problem instead of a loop interface problem

See another thread in freebsd-bugs about bugs in telnet LINEMODE.
I lost your example program, but the following simple program
shows the bug:

main()
{
    char buf[4];
    int i, nr;

    while (1) {
	nr = read(0, buf, sizeof buf);
	if (nr == 0)
	    exit(0);
	printf("\nread %d bytes:", nr);
	for (i = 0; i < nr; ++i)
	    printf(" %02x", (unsigned char)buf[i]);
	printf("\n");
    }
}

Run this and type `1^D' where ^D is the eof character for the tty.  The
read should return 1, but in telnet LINEMODE it doesn't return.  The
eol character is similarly broken (when set).  The eol2 character works.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612080824.TAA19537>