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
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
23 #if UsePUCCPtyd /* turn on in config/site.def */
24 PUCCPTYDDEF = -DPUCC_PTYD /* does not need to be setuid */
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
37 #include <sys/param.h> /* for NOFILE */
41 #include <local/openpty.h>
43 @@ -1681,109 +1682,8 @@ char *name;
49 return (openpty(pty, &tty, ttydev, NULL, NULL));
51 -#if defined(SYSV) && defined(i386) && !defined(SVR4)
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.
75 - if (pty_search(pty) == 0)
77 -#endif /* SYSV && i386 && !SVR4 */
78 -#if defined(ATT) && !defined(__sgi)
79 - if ((*pty = open ("/dev/ptmx", O_RDWR)) < 0) {
82 -#if defined(SVR4) || defined(i386)
83 - strcpy(ttydev, ptsname(*pty));
84 -#if defined (SYSV) && defined(i386) && !defined(SVR4)
91 - if ((*pty = open ("/dev/ptc", O_RDWR)) < 0) {
94 - strcpy(ttydev, ttyname(*pty));
97 -#if defined(__sgi) && OSMAJORVERSION >= 4
101 - tty_name = _getpty (pty, O_RDWR, 0622, 0);
104 - strcpy (ttydev, tty_name);
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);
122 -#endif /* __convex__ */
123 -#ifdef USE_GET_PSEUDOTTY
124 - return ((*pty = getpseudotty (&ttydev, &ptydev)) >= 0 ? 0 : 1);
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) {
133 - sprintf (ttydev, "/dev/ttyq%d", minor(fstat_buf.st_rdev));
135 - sprintf (ptydev, "/dev/ptyq%d", minor(fstat_buf.st_rdev));
136 - if ((*tty = open (ttydev, O_RDWR)) < 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 */