summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kiss/Makefile.am1
-rw-r--r--kiss/net2kiss.c49
2 files changed, 2 insertions, 48 deletions
diff --git a/kiss/Makefile.am b/kiss/Makefile.am
index e7dcf30..6f74c67 100644
--- a/kiss/Makefile.am
+++ b/kiss/Makefile.am
@@ -4,6 +4,7 @@ installconf:
sbin_PROGRAMS = kissattach kissnetd kissparms mkiss net2kiss
LDADD= $(AX25_LIB)
+net2kiss_LDADD = $(UTIL_LIB)
dist_man_MANS = kissattach.8 spattach.8 kissnetd.8 kissparms.8 mkiss.8 \
net2kiss.8
diff --git a/kiss/net2kiss.c b/kiss/net2kiss.c
index 093a191..9c0afef 100644
--- a/kiss/net2kiss.c
+++ b/kiss/net2kiss.c
@@ -45,6 +45,7 @@
#include <fcntl.h>
#include <signal.h>
#include <grp.h>
+#include <pty.h>
#include <string.h>
#include <termios.h>
#include <limits.h>
@@ -234,54 +235,6 @@ static void display_packet(unsigned char *bp, unsigned int len)
/* ---------------------------------------------------------------------- */
-static int openpty(int *amaster, int *aslave, char *name,
- struct termios *termp, struct winsize *winp)
-{
- char line[PATH_MAX];
- const char *cp1, *cp2;
- int master, slave;
- struct group *gr = getgrnam("tty");
-
- strcpy(line, "/dev/ptyXX");
- for (cp1 = "pqrstuvwxyzPQRST"; *cp1; cp1++) {
- line[8] = *cp1;
- for (cp2 = "0123456789abcdef"; *cp2; cp2++) {
- line[9] = *cp2;
- if ((master = open(line, O_RDWR, 0)) == -1) {
- if (errno == ENOENT)
- return -1; /* out of ptys */
- } else {
- line[5] = 't';
- chown(line, getuid(), gr ? gr->gr_gid : -1);
- chmod(line, S_IRUSR|S_IWUSR|S_IWGRP);
-#if 0
- revoke(line);
-#endif
- slave = open(line, O_RDWR, 0);
- if (slave != -1) {
- *amaster = master;
- *aslave = slave;
- if (name)
- strcpy(name, line);
- if (termp)
- tcsetattr(slave, TCSAFLUSH,
- termp);
- if (winp)
- ioctl(slave, TIOCSWINSZ,
- (char *)winp);
- return 0;
- }
- close(master);
- line[5] = 'p';
- }
- }
- }
- errno = ENOENT; /* out of ptys */
- return -1;
-}
-
-/* ---------------------------------------------------------------------- */
-
static void restore_ifflags(int signum)
{
if (ioctl(fdif, SIOCSIFFLAGS, &ifr) < 0)