$NetBSD: patch-ad,v 1.2 2004/06/12 12:44:33 grant Exp $

--- calldbx.c.orig	1995-06-20 08:11:00.000000000 +1000
+++ calldbx.c
@@ -74,11 +74,7 @@
 #include <string.h>
 #include <fcntl.h>
 #include "global.h"
-#if !(defined(OLDSUNOS) || defined(BSD))
-#include <termio.h>
-#else
-#include <sgtty.h>
-#endif
+#include <termios.h>
 
 #ifdef CREATE_IO_WINDOW
 #include	<sys/socket.h>
@@ -243,14 +239,7 @@ void calldbx(argc, argv)
 int argc;
 char *argv[];
 {
-/*
- * (JBL)10MAY91 : use sgttyb if generic BSD
- */
-#if !(defined(OLDSUNOS) || defined(BSD))
-    struct termio Termio;
-#else
-    struct sgttyb Termio;
-#endif
+    struct termios Termio;
     int  	  master;		/* file descriptor of master pty */
     int  	  slave; 		/* file descriptor of slave pty */
 #ifdef OLDBSD
@@ -355,17 +344,10 @@ char *argv[];
 	/*
 	 * (JBL)10MAY91 : use sgttyb if OLDSUN or generic BSD
 	 */ 
-#if !(defined(OLDSUNOS) || defined(BSD))
-	ioctl(slave, TCGETA, &Termio);
+	(void)tcgetattr(slave, &Termio);
 	Termio.c_lflag &= ~ECHO;	/* No echo */
 	Termio.c_oflag &= ~ONLCR;	/* Do not map NL to CR-NL on output */
-	ioctl(slave, TCSETA, &Termio);
-#else
-	ioctl(slave, TIOCGETP, &Termio);
-	Termio.sg_flags &= ~ECHO;	/* No echo */
-	Termio.sg_flags &= ~CRMOD;	/* Do not map NL to CR-NL on output */
-	ioctl(slave, TIOCSETP, &Termio);
-#endif
+	(void)tcsetattr(slave, TCSANOW, &Termio);
 
 	dup2(slave, 0);
 	dup2(slave, 1);
