Subject: pkg/17478: kterm should use openpty()
To: None <gnats-bugs@gnats.netbsd.org>
From: None <igy@arhc.org>
List: netbsd-bugs
Date: 07/04/2002 22:40:55
>Number:         17478
>Category:       pkg
>Synopsis:       kterm fails to find available pty.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 04 06:43:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6B
>Organization:
PRUG
>Environment:
System: NetBSD caolila 1.6B NetBSD 1.6B (CAOLILA) #0: Tue Jul 2 19:51:05 JST 2002 root@caolila:/net/src/sys/arch/i386/compile/CAOLILA i386
Architecture: i386
Machine: i386

>Description:
Currently, kterm is compiled to use pty_search().  pty_search() scans
/dev/ by its own matching rule.  The pty_search()'s rule covers just a
small part of the NetBSD's ptys.  If the all ptys covered by
pty_search() are already in use, pty_search() misunderstands there is
no available ptys.

>How-To-Repeat:
start X
open many kterms
finally you can see the message "kterm: no available ptys"
though ptys are availabe.

>Fix:
add this patches

-------- patch-ac --------
$NetBSD$
--- main.c.orig	Thu Jul  4 21:55:24 2002
+++ main.c	Thu Jul  4 21:55:55 2002
@@ -392,6 +392,10 @@
 #include <locale.h>
 #endif
 
+#ifdef __NetBSD__
+#include <util.h>
+#endif
+
 #ifdef SYSV
 extern char *ptsname();
 #endif
@@ -1719,7 +1723,7 @@
 get_pty (pty)
     int *pty;
 {
-#ifdef __osf__
+#if defined(__osf__) || defined(__NetBSD__)
     int tty;
     return (openpty(pty, &tty, ttydev, NULL, NULL));
 #endif
-------- patch-ac --------
-------- patch-ad --------
$NetBSD$
--- Imakefile.orig	Fri Jul 12 14:01:04 1996
+++ Imakefile	Thu Jul  4 22:04:55 2002
@@ -23,6 +23,9 @@
     PUCCPTYDDEF = -DPUCC_PTYD		/* does not need to be setuid */
          PTYLIB = -lpucc
 #endif
+#ifdef NetBSDArchitecture
+         PTYLIB = -lutil
+#endif
 
  OSMAJORVERSION = OSMajorVersion
  OSMINORVERSION = OSMinorVersion

-------- patch-ad --------

--
Naoto Shimazaki
>Release-Note:
>Audit-Trail:
>Unformatted: