public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paul Howarth <paul@city-fan.org>
To: git-commits@fedoraproject.org
Subject: [rpms/perl-IO-Tty] rawhide: Fix for rhbz#2463168 (perl-IO-Tty-1.24 or newer break coreutils test-suite)
Date: Tue, 02 Jun 2026 11:56:25 GMT	[thread overview]
Message-ID: <178040138541.1.15277257394278102717.rpms-perl-IO-Tty-1374bb7ee79b@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/perl-IO-Tty
            Branch : rawhide
            Commit : 1374bb7ee79bf796033aa2659e0e8f7479b28b46
            Author : Paul Howarth <paul@city-fan.org>
            Date   : 2026-06-02T12:41:20+01:00
            Stats  : +81/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/perl-IO-Tty/c/1374bb7ee79bf796033aa2659e0e8f7479b28b46?branch=rawhide

            Log:
            Fix for rhbz#2463168 (perl-IO-Tty-1.24 or newer break coreutils test-suite)

https://github.com/cpan-authors/IO-Tty/issues/91
https://github.com/cpan-authors/IO-Tty/pull/95

---
diff --git a/95.patch b/95.patch
new file mode 100644
index 0000000..7b860dc
--- /dev/null
+++ b/95.patch
@@ -0,0 +1,70 @@
+From 7fd37bf889d9cdd1bc25895059567761633a8fbe Mon Sep 17 00:00:00 2001
+From: Toddr Bot <toddbot@rinaldo.us>
+Date: Wed, 27 May 2026 22:20:31 +0000
+Subject: [PATCH] fix: don't cache slave in slave() after close_slave() (fixes
+ #91)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since v1.24, slave() cached the re-opened slave fd in the master's
+io_pty_slave hash entry. This kept the parent's slave fd alive after
+fork, preventing EOF detection on the master when the child exited.
+
+This broke GNU coreutils tty-eof.pl and any code that called
+$pty->slave from the parent just to do tcsetattr, expecting the fd
+to close when the reference went out of scope (the v1.23 behavior).
+
+Remove the caching so re-opened slaves are temporary — callers who
+need a persistent handle can store the return value themselves.
+
+Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
+---
+ Pty.pm    |  1 -
+ t/slave.t | 17 ++++++++++++++++-
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/Pty.pm b/Pty.pm
+index 66aae62..f12c670 100644
+--- a/Pty.pm
++++ b/Pty.pm
+@@ -85,7 +85,6 @@ sub slave {
+     $slave->autoflush(1);
+ 
+     ${*$slave}{'io_tty_ttyname'}    = $tty;
+-    ${*$master}{'io_pty_slave'}     = $slave;
+ 
+     return $slave;
+ }
+diff --git a/t/slave.t b/t/slave.t
+index a759ded..8dbd99a 100644
+--- a/t/slave.t
++++ b/t/slave.t
+@@ -3,7 +3,7 @@
+ use strict;
+ use warnings;
+ 
+-use Test::More tests => 8;
++use Test::More tests => 10;
+ use IO::Pty;
+ require POSIX;
+ 
+@@ -53,3 +53,18 @@ require POSIX;
+     ok( defined fileno($slave2),
+         "re-opened slave has a valid fileno" );
+ }
++
++# Test that slave() after close_slave() does not cache (GitHub #91)
++# If the re-opened slave is cached, the parent keeps an open fd to the
++# slave side, preventing EOF detection on the master when the child exits.
++{
++    my $pty = IO::Pty->new;
++    $pty->close_slave;
++
++    my $slave_tmp = $pty->slave;
++    ok( defined fileno($slave_tmp), "temporary slave has valid fd" );
++    undef $slave_tmp;
++
++    ok( ! exists ${*$pty}{'io_pty_slave'},
++        "slave() after close_slave() does not re-cache" );
++}

diff --git a/perl-IO-Tty.spec b/perl-IO-Tty.spec
index 785f6d6..baeaad0 100644
--- a/perl-IO-Tty.spec
+++ b/perl-IO-Tty.spec
@@ -1,10 +1,11 @@
 Name:           perl-IO-Tty
 Version:        1.31
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Perl interface to pseudo tty's
 License:        (GPL-1.0-or-later OR Artistic-1.0-Perl) AND BSD-2-Clause
 URL:            https://metacpan.org/release/IO-Tty
 Source0:        https://cpan.metacpan.org/modules/by-module/IO/IO-Tty-%{version}.tar.gz
+Patch0:         https://patch-diff.githubusercontent.com/raw/cpan-authors/IO-Tty/pull/95.patch
 # Module Build
 BuildRequires:  coreutils
 BuildRequires:  findutils
@@ -39,6 +40,11 @@ IO::Tty and IO::Pty provide an interface to pseudo tty's.
 %prep
 %setup -q -n IO-Tty-%{version}
 
+# Fix for rhbz#2463168 (perl-IO-Tty-1.24 or newer break coreutils test-suite)
+# https://github.com/cpan-authors/IO-Tty/issues/91
+# https://github.com/cpan-authors/IO-Tty/pull/95
+%patch -P0 -p1
+
 %build
 perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1 NO_PERLLOCAL=1
 %{make_build}
@@ -61,6 +67,10 @@ make test
 %{_mandir}/man3/IO::Tty::Constant.3*
 
 %changelog
+* Tue Jun  2 2026 Paul Howarth <paul@city-fan.org> - 1.31-2
+- Fix for rhbz#2463168 (perl-IO-Tty-1.24 or newer break coreutils test-suite)
+  (GH#91, GH#95)
+
 * Mon May 25 2026 Paul Howarth <paul@city-fan.org> - 1.31-1
 - Update to 1.31 (rhbz#2481113)
   Bug Fixes:

                 reply	other threads:[~2026-06-02 11:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178040138541.1.15277257394278102717.rpms-perl-IO-Tty-1374bb7ee79b@fedoraproject.org \
    --to=paul@city-fan.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox