From: Chris Hanson <org/chris-hanson/cph>
Date: Tue, 3 Apr 2001 17:52:21 +0000 (+0000)
Subject: Fix bug: examination of results from `poll' was ignoring file
X-Git-Tag: 20090517-FFI~2873
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d95db20124f26423571bb2f28889899c580b033c;p=mit-scheme.git

Fix bug: examination of results from `poll' was ignoring file
descriptors on which there were error conditions but no input.
---

diff --git a/v7/src/microcode/uxio.c b/v7/src/microcode/uxio.c
index 649c5b337..60ecb2934 100644
--- a/v7/src/microcode/uxio.c
+++ b/v7/src/microcode/uxio.c
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Id: uxio.c,v 1.45 2000/12/05 21:23:49 cph Exp $
+$Id: uxio.c,v 1.46 2001/04/03 17:51:52 cph Exp $
 
-Copyright (c) 1990-2000 Massachusetts Institute of Technology
+Copyright (c) 1990-2001 Massachusetts Institute of Technology
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -16,7 +16,8 @@ General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA.
 */
 
 #include "ux.h"
@@ -446,15 +447,18 @@ DEFUN (UX_select_registry_test, (input_fds, blockp, output_fds, output_nfds),
 	    (*output_nfds) = nfds;
 	  if (output_fds != 0)
 	    {
-	      unsigned int i;
-	      for (i = 0; (i < n_pfds); i += 1)
-		if ((((pfds [i]) . fd) != (-1))
-		    && ((((pfds [i]) . revents) & POLLIN) != 0))
-		  {
-		    (*output_fds++) = ((pfds [i]) . fd);
-		    if ((--nfds) == 0)
-		      break;
-		  }
+	      struct pollfd * scan = pfds;
+	      struct pollfd * end = (scan + n_pfds);
+	      while (scan < end)
+		{
+		  if (((scan -> fd) != (-1)) && ((scan -> revents) != 0))
+		    {
+		      (*output_fds++) = (scan -> fd);
+		      if ((--nfds) == 0)
+			break;
+		    }
+		  scan += 1;
+		}
 	    }
 	  return (select_input_argument);
 	}
diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h
index d4fc7e9cb..5c485979d 100644
--- a/v7/src/microcode/version.h
+++ b/v7/src/microcode/version.h
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: version.h,v 11.179 2001/03/08 06:28:34 cph Exp $
+$Id: version.h,v 11.180 2001/04/03 17:52:21 cph Exp $
 
 Copyright (c) 1988-2001 Massachusetts Institute of Technology
 
@@ -16,7 +16,8 @@ General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA.
 */
 
 /* This file contains version information for the microcode. */
@@ -24,7 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 /* Scheme system release version */
 
 #ifndef SCHEME_RELEASE
-#define SCHEME_RELEASE		"7.5.15"
+#define SCHEME_RELEASE		"7.5.17"
 #endif
 
 /* Microcode release version */
@@ -33,5 +34,5 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #define SCHEME_VERSION		14
 #endif
 #ifndef SCHEME_SUBVERSION
-#define SCHEME_SUBVERSION	3
+#define SCHEME_SUBVERSION	4
 #endif