summaryrefslogtreecommitdiff
path: root/misc/screen/patches
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2002-05-21 17:57:03 +0000
committertron <tron@pkgsrc.org>2002-05-21 17:57:03 +0000
commit7c58683c081f519e853739bb70771df59a5fa009 (patch)
treeaa7dafff3827d9c9521ee3318a85bcd2ec3cc161 /misc/screen/patches
parentd8edd40cfacb4f1b3b0092cae1acb550869774f3 (diff)
downloadpkgsrc-7c58683c081f519e853739bb70771df59a5fa009.tar.gz
Use openpty(3) to allocate a new pty under NetBSD. This fixes PR pkg/16901
by Bernd Ernesti.
Diffstat (limited to 'misc/screen/patches')
-rw-r--r--misc/screen/patches/patch-aa52
1 files changed, 52 insertions, 0 deletions
diff --git a/misc/screen/patches/patch-aa b/misc/screen/patches/patch-aa
new file mode 100644
index 00000000000..7f0cef36d8b
--- /dev/null
+++ b/misc/screen/patches/patch-aa
@@ -0,0 +1,52 @@
+$NetBSD: patch-aa,v 1.8 2002/05/21 17:57:04 tron Exp $
+
+--- pty.c.orig Mon Feb 11 13:44:18 2002
++++ pty.c Tue May 21 19:55:36 2002
+@@ -318,6 +318,47 @@
+
+ /***************************************************************/
+
++#if defined(__NetBSD__) && !defined(PTY_DONE)
++#define PTY_DONE
++
++#include <sys/param.h>
++
++#include <string.h>
++#include <util.h>
++
++int
++OpenPTY(ttyn)
++char **ttyn;
++{
++ int m, s, f;
++ char *t;
++
++ do
++ {
++ if (openpty(&m, &s, TtyName, NULL, NULL) < 0)
++ return -1;
++ close(m);
++ close(s);
++
++ strcpy(PtyName, TtyName);
++ t = strrchr(PtyName, '/');
++ if ((t == NULL ) || (*++t != 't'))
++ return -1;
++ *t = 'p';
++
++ f = open(PtyName, O_RDWR | O_NOCTTY);
++ }
++ while (f < 0);
++
++ initmaster(f);
++ *ttyn = TtyName;
++
++ return f;
++}
++#endif
++
++/***************************************************************/
++
+ #ifndef PTY_DONE
+ int
+ OpenPTY(ttyn)