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

Re: [MiNT] FreeMiNT 1.18 release



On 01/26/13 11:02, Helmut Karlowski wrote:
Alan Hourihane, 26.01.2013 01:41:56:

Why this specific version of toswin2, what's wrong with the one in the
trunk code ?

That's only for 000, and compiled with -O0 AFAIK. But the latest trunk-toswin also suffers from this.

Can someone who is experiencing this problem try this patch ?

No change, at least with my optimized toswin-version.


Any chance you can try this one ?

Thanks,

Alan.
Index: proc.c
===================================================================
RCS file: /mint/freemint/tools/toswin2/proc.c,v
retrieving revision 1.11
diff -u -r1.11 proc.c
--- proc.c	22 Jan 2008 13:42:46 -0000	1.11
+++ proc.c	26 Jan 2013 12:03:23 -0000
@@ -403,6 +403,7 @@
 
 	if (fdmask) 
 	{
+again:
 		readfds = fdmask;
 		if ((r = Fselect(1, &readfds, 0L, 0L)) > 0) 
 		{
@@ -416,19 +417,23 @@
 					continue;
 				if (readfds & (1L << t->fd)) 
 				{
-					long int read_bytes =
-						Fread(t->fd, (long)READBUFSIZ, buf);
-					if (read_bytes > 0)
+					r = Fread(t->fd, (long)READBUFSIZ, buf);
+					if (r > 0)
 					{
-						write_text(t, buf, read_bytes);
+						write_text(t, buf, r);
 						if (t->fd == con_fd)
-							handle_console(buf, read_bytes);
+							handle_console(buf, r);
 					}
-					else
+					else if (r != EINTR)
 						checkdead |= (1L << t->fd);
 				}
 			}
 		}
+
+		/* Select was interrupted, try again. */
+		if (r == -EINTR)
+			goto again;
+
 		if (checkdead)
 			rebuild_fdmask(checkdead);
 	}