$NetBSD: patch-an,v 1.2 2003/03/31 03:46:30 jmc Exp $

--- glunix/src/rexec/lrexec.cc.orig	Thu Oct  2 19:34:06 1997
+++ glunix/src/rexec/lrexec.cc	Sun Mar 30 21:55:03 2003
@@ -293,6 +293,9 @@
 #include <termios.h>
 #include <unistd.h>
 #include <limits.h>
+#ifdef __NetBSD__
+#include <sys/ioctl.h>
+#endif
 
 #include "glib/types.h"
 #include "glib.h"
@@ -375,39 +378,30 @@
 {
     struct termios buf;
 
-    (void) ioctl(0, TCGETS, (char *)&saveTermios);
-
-    /*    while(tcgetattr(STDIN_FILENO, &saveTermios) == -1) {
+#ifdef __NetBSD__
+        while(tcgetattr(STDIN_FILENO, &saveTermios) == -1) {
 	if(errno == EINTR) {
 	    continue;
 	} else {
 	    D1("tcgetattr() failed: %s\n", strerror(errno));
-	    return False;
+	    return;
 	}
-    }*/
-
+    }
+#else
+    (void) ioctl(0, TCGETS, (char *)&saveTermios);
+#endif
     validTermios = True;
 
-    /*    if(ioctl(STDIN_FILENO, TIOCGWINSZ, (char *) windowSize) == -1) {
+    /*
+      if(ioctl(STDIN_FILENO, TIOCGWINSZ, (char *) windowSize) == -1) {
 	return False;
     }*/
 
     buf = saveTermios;
 
-    /**/
-
-	buf.c_iflag &= ~(INLCR|IGNCR|ICRNL|IUCLC|IXON);
-	//	buf.c_oflag &= ~OPOST;
-	buf.c_lflag &= ~(ICANON|ECHO|ISIG);
-	buf.c_cc[VMIN] = 1;
-	buf.c_cc[VTIME] = 0;
-	(void) ioctl(0, TCSETSF, (char *)&buf);
-
-    /**/
-	
-	/*
+#ifdef __NetBSD__
     buf.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
-//  buf.c_oflag &= ~(OPOST); on non-ultrasparcs, this loses CR's
+    buf.c_oflag &= ~(OPOST); /*on non-ultrasparcs, this loses CR's*/
     buf.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
     buf.c_cflag &= ~(CSIZE | PARENB);
     buf.c_cflag |= CS8;
@@ -426,14 +420,20 @@
 		    continue;
 		} else {
 		    D1("tcsetattr(): %s\n", strerror(errno));
-		    return False;
+	    return;
 		}
 	    }
 	    
-	    return False;
+	return;
 	}
-    }*/
-
+    }
+#else
+	buf.c_iflag &= ~(INLCR|IGNCR|ICRNL|IUCLC|IXON);
+	buf.c_lflag &= ~(ICANON|ECHO|ISIG);
+	buf.c_cc[VMIN] = 1;
+	buf.c_cc[VTIME] = 0;
+	(void) ioctl(0, TCSETSF, (char *)&buf);
+#endif
     Comm_SetLineBuffering(False);
    
     return;
