OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
4.7 KiB

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