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

Mint bug & patch



Hi all,

yesterday I discovered a bug in Mint, resulting in incorrect return values of
read() and write() calls to certain terminals.
Actually I had a program trying to write 15 bytes to /dev/aux, which were
transmitted ok, but Mint returned having written 0 bytes, so my program trying
again and again and agian...

Here's a patch to cure the problem,

Richard.

*** tty.c.orig  Sun Jul 31 16:49:24 1994
--- tty.c       Sun Jul 31 18:32:38 1994
***************
*** 129,134 ****
--- 129,135 ----
		return bytes_read;
  #endif

+       bytes_read = 0;         /* Re-initialize in case of EUNDEV */
	ptr = buf;

	while (bytes_read < nbytes) {
***************
*** 389,394 ****
--- 390,396 ----
   */


+       bytes_written = 0;      /* Re-initialize in case of EUNDEV */
	if (nbytes == 0) return bytes_written;
	c = *ptr++;