summaryrefslogtreecommitdiff
path: root/net/rp-l2tp/patches/patch-ac
blob: 25ec7b9551aad7a630faadef3c1bc4943b977bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-ac,v 1.2 2006/05/12 09:41:16 joerg Exp $

--- handlers/pty.c.orig	2002-09-30 19:45:00.000000000 +0000
+++ handlers/pty.c
@@ -21,7 +21,12 @@ static char const RCSID[] =
 #include <termios.h>
 #include <fcntl.h>
 #include <stdio.h>
-#ifndef N_HDLC
+#ifdef __NetBSD__
+#include <util.h>
+#elif defined(__DragonFly__) || defined(__FreeBSD__)
+#include <libutil.h>
+#endif
+#if defined(__linux__) && !defined(N_HDLC)
 #include <linux/termios.h>
 #endif
 
@@ -39,6 +44,9 @@ static char const RCSID[] =
 int
 pty_get(int *mfp, int *sfp)
 {
+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
+	return openpty(mfp, sfp, NULL, NULL, NULL);
+#else
     char pty_name[24];
     struct termios tios;
     int mfd, sfd;
@@ -92,5 +100,6 @@ pty_get(int *mfp, int *sfp)
 	return -1;
     }
     return 0;
+#endif
 }