diff -urN hercules-1.50.orig/console.c hercules-1.50/console.c
--- hercules-1.50.orig/console.c	Wed Feb  9 12:33:18 2000
+++ hercules-1.50/console.c	Fri Feb 11 13:35:59 2000
@@ -1103,6 +1103,38 @@
         if (rc < 0 )
         {
             if (errno == EINTR) continue;
+
+	    /* begin Linux/390 grossness hack */
+	    /* Linux/390 sets errno incorrectly in select().
+	       Further, the number does not stay constant between Hercules
+	       versions.  My theory--we're returning the address of the
+	       piece of the stack that contains errno, rather than the 
+	       value at that address, since the number is always a little 
+	       less than 0x80000000.  All we check for is whether errno is
+	       greater than 2 ** 30.
+
+	       Sorry.  I know this is gross.
+
+	       AJT 20000211 */
+
+	    if (errno > (1 << 30)) {
+	      int deref_level = 0;
+	      int temp_errno = errno;
+	      char *deref_string;
+
+	      while (temp_errno > (1 << 30)) {
+
+	        deref_level++;
+  	        temp_errno = *(int *)temp_errno; /* Let's test that hypothesis */
+	        }
+	      TNSERROR("Linux/390--select required %d deref levels.\n",deref_level);
+	      deref_string = calloc(deref_level + 1,sizeof(char));
+	      memset(deref_string,'*',deref_level);
+	      TNSERROR("Linux/390--%serrno = %d.\n",deref_string,temp_errno);
+	    }
+	    if (errno > (1 << 30)) continue;
+  	    /* End Linux/390 grossness hack */
+
             TNSERROR("select: %s\n", strerror(errno));
             break;
         }
diff -urN hercules-1.50.orig/makefile hercules-1.50/makefile
--- hercules-1.50.orig/makefile	Thu Feb 10 13:53:32 2000
+++ hercules-1.50/makefile	Fri Feb 11 09:07:18 2000
@@ -8,9 +8,9 @@
 
 VERSION  = 1.50
 
-CFLAGS	 = -O3 -Wall -fPIC -DVERSION=$(VERSION) -DARCH=390
+CFLAGS	 = -O1 -Wall -fPIC -DVERSION=$(VERSION) -DARCH=390
 #	   -march=pentium -malign-double -mwide-multiply
-CFL_370  = -O3 -Wall -fPIC -DVERSION=$(VERSION) -DARCH=370
+CFL_370  = -O1 -Wall -fPIC -DVERSION=$(VERSION) -DARCH=370
 #	   -march=pentium -malign-double -mwide-multiply
 LFLAGS	 = -lpthread
 
