pty library
[unix-history] / usr / src / libexec / telnetd / telnetd.c
index 2df6780..b6a70d5 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)telnetd.c  5.45 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c  5.46 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "telnetd.h"
 #endif /* not lint */
 
 #include "telnetd.h"
@@ -449,7 +449,14 @@ doit(who)
        char *host, *inet_ntoa();
        int t;
        struct hostent *hp;
        char *host, *inet_ntoa();
        int t;
        struct hostent *hp;
+#if BSD > 43
+       extern char *line;
 
 
+       if (openpty(&pty, &t, line, NULL, NULL) == -1)
+               fatal(net, "All network ports in use");
+       init_termbuf();
+#else
+       
        /*
         * Find an available pty to use.
         */
        /*
         * Find an available pty to use.
         */
@@ -458,6 +465,7 @@ doit(who)
                fatal(net, "All network ports in use");
 
        t = getptyslave();
                fatal(net, "All network ports in use");
 
        t = getptyslave();
+#endif
 
        /* get name of connected client */
        hp = gethostbyaddr((char *)&who->sin_addr, sizeof (struct in_addr),
 
        /* get name of connected client */
        hp = gethostbyaddr((char *)&who->sin_addr, sizeof (struct in_addr),