cgit: Added cgit 0.7.3-c502865 - A CGI for git written in C
[opensde-package-nopast.git] / x11 / kterm / kterm-devfs-aware.patch
blob5fc1f803381c1e6aca14cd2164b9cffa8320be0a
1 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # Filename: package/.../kterm/kterm-devfs-aware.patch
5 # Copyright (C) 2004 - 2006 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 Clifford Wolf
8 # More information can be found in the files COPYING and README.
10 # This patch file is dual-licensed. It is available under the license the
11 # patched project is licensed under, as long as it is an OpenSource license
12 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
13 # of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
15 # version.
16 # --- SDE-COPYRIGHT-NOTE-END ---
18 diff -pruN kterm-6.2.0/Imakefile kterm-6.2.0_new/Imakefile
19 --- kterm-6.2.0/Imakefile 1996-07-12 07:01:04.000000000 +0200
20 +++ kterm-6.2.0_new/Imakefile 2003-08-16 15:23:27.000000000 +0200
21 @@ -21,8 +21,9 @@ XCOMM $Id: Imakefile,v 6.3 1996/07/12 05
22 #endif
23 #if UsePUCCPtyd /* turn on in config/site.def */
24 PUCCPTYDDEF = -DPUCC_PTYD /* does not need to be setuid */
25 - PTYLIB = -lpucc
26 + PTYLIBN = -lpucc
27 #endif
28 +PTYLIB = $(PTYLIBN) -lutil
30 OSMAJORVERSION = OSMajorVersion
31 OSMINORVERSION = OSMinorVersion
32 diff -pruN kterm-6.2.0/main.c kterm-6.2.0_new/main.c
33 --- kterm-6.2.0/main.c 2003-08-16 15:25:26.000000000 +0200
34 +++ kterm-6.2.0_new/main.c 2003-08-16 15:19:35.000000000 +0200
35 @@ -286,6 +286,7 @@ extern struct utmp *getutid __((struct u
36 #endif
37 #include <sys/param.h> /* for NOFILE */
39 +#include <pty.h>
40 #ifdef PUCC_PTYD
41 #include <local/openpty.h>
42 int Ptyfd;
43 @@ -1681,109 +1682,8 @@ char *name;
44 get_pty (pty)
45 int *pty;
47 -#ifdef __osf__
48 int tty;
49 return (openpty(pty, &tty, ttydev, NULL, NULL));
50 -#endif
51 -#if defined(SYSV) && defined(i386) && !defined(SVR4)
52 - /*
53 - The order of this code is *important*. On SYSV/386 we want to open
54 - a /dev/ttyp? first if at all possible. If none are available, then
55 - we'll try to open a /dev/pts??? device.
57 - The reason for this is because /dev/ttyp? works correctly, where
58 - as /dev/pts??? devices have a number of bugs, (won't update
59 - screen correcly, will hang -- it more or less works, but you
60 - really don't want to use it).
62 - Most importantly, for boxes of this nature, one of the major
63 - "features" is that you can emulate a 8086 by spawning off a UNIX
64 - program on 80386/80486 in v86 mode. In other words, you can spawn
65 - off multiple MS-DOS environments. On ISC the program that does
66 - this is named "vpix." The catcher is that "vpix" will *not* work
67 - with a /dev/pts??? device, will only work with a /dev/ttyp? device.
69 - Since we can open either a /dev/ttyp? or a /dev/pts??? device,
70 - the flag "IsPts" is set here so that we know which type of
71 - device we're dealing with in routine spawn(). That's the reason
72 - for the "if (IsPts)" statement in spawn(); we have two different
73 - device types which need to be handled differently.
74 - */
75 - if (pty_search(pty) == 0)
76 - return 0;
77 -#endif /* SYSV && i386 && !SVR4 */
78 -#if defined(ATT) && !defined(__sgi)
79 - if ((*pty = open ("/dev/ptmx", O_RDWR)) < 0) {
80 - return 1;
81 - }
82 -#if defined(SVR4) || defined(i386)
83 - strcpy(ttydev, ptsname(*pty));
84 -#if defined (SYSV) && defined(i386) && !defined(SVR4)
85 - IsPts = True;
86 -#endif
87 -#endif
88 - return 0;
89 -#else /* ATT else */
90 -#ifdef AIXV3
91 - if ((*pty = open ("/dev/ptc", O_RDWR)) < 0) {
92 - return 1;
93 - }
94 - strcpy(ttydev, ttyname(*pty));
95 - return 0;
96 -#endif
97 -#if defined(__sgi) && OSMAJORVERSION >= 4
98 - {
99 - char *tty_name;
101 - tty_name = _getpty (pty, O_RDWR, 0622, 0);
102 - if (tty_name == 0)
103 - return 1;
104 - strcpy (ttydev, tty_name);
105 - return 0;
107 -#endif
108 -#ifdef __convex__
110 - char *pty_name, *getpty();
112 - while ((pty_name = getpty()) != NULL) {
113 - if ((*pty = open (pty_name, O_RDWR)) >= 0) {
114 - strcpy(ptydev, pty_name);
115 - strcpy(ttydev, pty_name);
116 - ttydev[5] = 't';
117 - return 0;
120 - return 1;
122 -#endif /* __convex__ */
123 -#ifdef USE_GET_PSEUDOTTY
124 - return ((*pty = getpseudotty (&ttydev, &ptydev)) >= 0 ? 0 : 1);
125 -#else
126 -#if (defined(__sgi) && OSMAJORVERSION < 4) || (defined(umips) && defined (SYSTYPE_SYSV))
127 - struct stat fstat_buf;
129 - *pty = open ("/dev/ptc", O_RDWR);
130 - if (*pty < 0 || (fstat (*pty, &fstat_buf)) < 0) {
131 - return(1);
133 - sprintf (ttydev, "/dev/ttyq%d", minor(fstat_buf.st_rdev));
134 -#ifndef __sgi
135 - sprintf (ptydev, "/dev/ptyq%d", minor(fstat_buf.st_rdev));
136 - if ((*tty = open (ttydev, O_RDWR)) < 0) {
137 - close (*pty);
138 - return(1);
140 -#endif /* !__sgi */
141 - /* got one! */
142 - return(0);
143 -#else /* __sgi or umips */
145 - return pty_search(pty);
147 -#endif /* __sgi or umips else */
148 -#endif /* USE_GET_PSEUDOTTY else */
149 -#endif /* ATT else */