ports/108311: [PATCH] Restore openpty() use in Expect

Lars Erik Gullerud lerik at nolink.net
Wed Jan 24 15:10:16 UTC 2007


>Number:         108311
>Category:       ports
>Synopsis:       [PATCH] Restore openpty() use in Expect
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 24 15:10:15 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Lars Erik Gullerud
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD saturn.noc.catch.no 6.2-STABLE FreeBSD 6.2-STABLE #0: Wed Jan 17 13:46:31 CET 2007 root at saturn.noc.catch.no:/usr/obj/usr/src/sys/SATURN i386


	
>Description:
 - Remove CONFIGURE_ENV from Makefile, configure picks this up itself
 - Retire patch-pty_termios.c
>How-To-Repeat:
	
>Fix:

Makefile revision 1.61 introduced "LDFLAGS -lutil" to CONFIGURE_ENV to solve
a build error. This problem has since been fixed upstream in the configure
script which now checks for -lutil. However, the CONFIGURE_ENV in our
Makefile now causes the HAVE_OPENPTY #define in expect_cf.h to be dropped,
leading to openpty() no longer being used, and PTY_TYPE to be termios
(legacy).

This is the root cause of the "only 64 pty's" problem that was worked around
with the patch-pty_termios.c patch introduced at the PORTREVISION bump in
Makefile 1.70. The patch only corrects the symptom (wrong master/slave pty
names in pty_termios.c) not the root cause, as Expect should not be using
termios at all but rather openpty() which supports any number of pty's
available on the system and is POSIX supported.

Removing the now unnecessary CONFIGURE_ENV allows the configure script
to correctly pick up HAVE_OPENPTY and use openpty() instead.

/leg

--- diff.txt begins here ---
diff -ruN /usr/ports/lang/expect/Makefile ./expect/Makefile
--- /usr/ports/lang/expect/Makefile	Fri Dec 29 03:29:19 2006
+++ ./expect/Makefile	Wed Jan 24 14:30:34 2007
@@ -44,7 +44,6 @@
 		--with-tclconfig=${LOCALBASE}/lib/tcl8.4 \
 		--with-tclinclude=${LOCALBASE}/include/tcl8.4 \
 		${TK_CONFIG_ARGS}
-CONFIGURE_ENV=	LDFLAGS="-lutil"
 
 .if !defined(NO_MAN_INSTALL)
 MAN1=		autoexpect.1 cryptdir.1 decryptdir.1 dislocate.1 \
diff -ruN /usr/ports/lang/expect/files/patch-pty_termios.c ./expect/files/patch-pty_termios.c
--- /usr/ports/lang/expect/files/patch-pty_termios.c	Fri Oct  6 03:47:56 2006
+++ ./expect/files/patch-pty_termios.c	Thu Jan  1 01:00:00 1970
@@ -1,20 +0,0 @@
---- pty_termios.c.orig	Fri May  7 17:46:03 2004
-+++ pty_termios.c	Fri Oct  6 01:17:48 2006
-@@ -166,7 +166,7 @@
- static char	*slave_bank;
- static char	*slave_num;
- #else
--static char	banks[] = "pqrstuvwxyzPQRSTUVWXYZ";
-+static char	banks[] = "pqrsPQRS";	/* FreeBSD scheme */
- static char	master_name[] = "/dev/ptyXX";
- static char	slave_name [] = "/dev/ttyXX";
- #endif /* HAVE_PTYM */
-@@ -489,7 +489,7 @@
- 		*tty_bank = *bank;
- 		*tty_num = '0';
- 		if (stat(master_name, &stat_buf) < 0) break;
--		for (hex = "0123456789abcdef";*hex;hex++) {
-+		for (hex = "0123456789abcdefghijklmnopqrstuv";*hex;hex++) {
- 			*tty_num = *hex;
- 			strcpy(slave_name,master_name);
- 			*tty_type = 't';
--- diff.txt ends here ---


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



More information about the freebsd-ports-bugs mailing list