pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/p5-IO-Tty IO::Tty was broken on NetBSD >= 3.0.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e399fda19bdc
branches:  trunk
changeset: 508429:e399fda19bdc
user:      heinz <heinz%pkgsrc.org@localhost>
date:      Sun Feb 19 01:28:53 2006 +0000

description:
IO::Tty was broken on NetBSD >= 3.0.
patch-ab is only an unintrusive short-term fix, discussion with the authors
how to fix it correctly has started.

NetBSD >= 3.0 supports grantpt() but it invalidates the slave
FD (see grantpt(3) on NetBSD) obtained through openpty() so we discard
the (now invalid) descriptor for the slave tty. This causes Tty.xs to open
the slave tty again.

The issue should be really fixed by using posix_openpt() instead of
openpty(). The functions posix_openpt(), grantpt(), unlockpt()
and ptsname() belong together and should be used ahead of
all the other ways to create the master and slave tty, not just
on NetBSD. See also
http://www.opengroup.org/onlinepubs/009695399/functions/posix_openpt.html

diffstat:

 devel/p5-IO-Tty/Makefile         |   4 ++--
 devel/p5-IO-Tty/distinfo         |   3 ++-
 devel/p5-IO-Tty/patches/patch-ab |  28 ++++++++++++++++++++++++++++
 3 files changed, 32 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r e60cd1d29e72 -r e399fda19bdc devel/p5-IO-Tty/Makefile
--- a/devel/p5-IO-Tty/Makefile  Sun Feb 19 01:01:39 2006 +0000
+++ b/devel/p5-IO-Tty/Makefile  Sun Feb 19 01:28:53 2006 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.17 2005/08/06 06:19:11 jlam Exp $
+# $NetBSD: Makefile,v 1.18 2006/02/19 01:28:53 heinz Exp $
 #
 
 DISTNAME=      IO-Tty-1.02
 PKGNAME=       p5-${DISTNAME:C/T/t/}
 SVR4_PKGNAME=  p5itt
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    devel perl5
 MASTER_SITES=  ${MASTER_SITE_PERL_CPAN:=IO/}
 
diff -r e60cd1d29e72 -r e399fda19bdc devel/p5-IO-Tty/distinfo
--- a/devel/p5-IO-Tty/distinfo  Sun Feb 19 01:01:39 2006 +0000
+++ b/devel/p5-IO-Tty/distinfo  Sun Feb 19 01:28:53 2006 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.6 2005/02/23 22:24:26 agc Exp $
+$NetBSD: distinfo,v 1.7 2006/02/19 01:28:53 heinz Exp $
 
 SHA1 (IO-Tty-1.02.tar.gz) = 466e634f5863190a25cb9f3c0878cfe2fe68a3a0
 RMD160 (IO-Tty-1.02.tar.gz) = ac3ec521bad4f7835a9c15cbeb60fe6f85399f98
 Size (IO-Tty-1.02.tar.gz) = 23105 bytes
+SHA1 (patch-ab) = 3465382b06e4facf1b5b5403b69fa7ff1011ff9a
diff -r e60cd1d29e72 -r e399fda19bdc devel/p5-IO-Tty/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/p5-IO-Tty/patches/patch-ab  Sun Feb 19 01:28:53 2006 +0000
@@ -0,0 +1,28 @@
+$NetBSD: patch-ab,v 1.1 2006/02/19 01:28:53 heinz Exp $
+
+--- Tty.xs.orig        2002-03-06 14:47:32.000000000 +0100
++++ Tty.xs
+@@ -300,6 +300,23 @@ open_slave(int *ptyfd, int *ttyfd, char 
+           if (PL_dowarn)
+               warn("IO::Tty::pty_allocate(nonfatal): grantpt(): %.100s", strerror(errno));
+       }
++
++#if defined(__NetBSD__)
++      /* NetBSD >= 3.0 supports grantpt() but it invalidates the slave
++         FD (see grantpt(3) on NetBSD) obtained through openpty().
++         The slave device will be opened again below.
++       */
++      *ttyfd = -1;
++
++      /* The issue should be really fixed by using posix_openpt() instead of
++         openpty(). The functions posix_openpt(), grantpt(), unlockpt()
++         and ptsname() belong together and should be used ahead of
++         all the other ways to create the master and slave tty, not just
++         on NetBSD. See also
++         http://www.opengroup.org/onlinepubs/009695399/functions/posix_openpt.html
++       */
++#endif
++
+ #endif /* HAVE_GRANTPT */
+ #if defined(HAVE_UNLOCKPT)
+ #if PTY_DEBUG



Home | Main Index | Thread Index | Old Index