Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-IO-Tty for openSUSE:Factory checked in at 2026-05-20 15:23:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-IO-Tty (Old) and /work/SRC/openSUSE:Factory/.perl-IO-Tty.new.1966 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-IO-Tty" Wed May 20 15:23:27 2026 rev:31 rq:1353766 version:1.290.0 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-IO-Tty/perl-IO-Tty.changes 2026-04-15 16:05:27.497188478 +0200 +++ /work/SRC/openSUSE:Factory/.perl-IO-Tty.new.1966/perl-IO-Tty.changes 2026-05-20 15:23:50.708469854 +0200 @@ -1,0 +2,74 @@ +Fri Apr 24 07:15:28 UTC 2026 - Tina Müller <[email protected]> + +- updated to 1.290.0 (1.29) + see /usr/share/doc/packages/perl-IO-Tty/ChangeLog + + 1.29 2026-04-23 Todd Rinaldo <[email protected]> + Bug Fixes: + * GH #87, PR #88 - Fix configure-time function detection probes being + broken by compiler optimization. The probes stored function pointers + in local variables which -O2/-Os (added to probe flags in PR #81) + eliminated as dead stores, so the linker never saw the function + reference. On systems where openpty() lives in -lutil (older glibc, + BSDs), the probe falsely succeeded without -lutil, producing + "undefined symbol: openpty" at runtime. Fixed by storing the + function pointer in a file-scope global variable which the optimizer + cannot eliminate. + Maintenance: + * PR #89 - Add Ubuntu LTS version matrix (20.04, 22.04, 24.04) to the + GitHub Actions test suite. Exercises the system perl on each current + Ubuntu LTS release via Docker containers, running after the main + ubuntu job. + 1.28 2026-04-23 Todd Rinaldo <[email protected]> + Bug Fixes: + * PR #69 - Fix make_slave_controlling_terminal() on Solaris/HP-UX to use + _open_tty() instead of IO::Tty->open(), ensuring STREAMS modules (ptem, + ldterm, ttcompat) are pushed via I_PUSH when the slave is opened for + controlling terminal setup. Parallel fix to the slave() method fix in + 1.24. + * PR #74 - Fix Perl 5.40+ "Possible memory corruption: ioctl overflowed + 3rd argument" warning in clone_winsize_from() and get_winsize(). Use + pack_winsize(0,0,0,0) to pre-allocate the ioctl buffer with SvCUR + matching sizeof(struct winsize) instead of an empty string. + * PR #76, PR #79 - Fix diagnostic warnings being silently suppressed when + callers use lexical "use warnings" (the modern standard since Perl 5.6). + $^W and PL_dowarn only fire under perl -w; replaced with + warnings::enabled() in IO::Tty and IO::Pty (PR #76) and ckWARN(WARN_IO) + in Tty.xs (PR #79). + * PR #77 - Fix file descriptor leak in IO::Pty when new_from_fd() fails + after pty_allocate() or _open_tty() returns raw C-level fds. Added + POSIX::close() calls on the raw fds before croaking at three sites in + new() and slave(). + * PR #78 - Fix openpty() detection on Alpine Linux and other musl-based + systems where openpty() has moved from libutil into libc (glibc 2.34+). + Probe libc first before falling back to -lutil. + * PR #80 - Fix -Wsign-compare compiler warnings: change namebuflen + parameter type from int to size_t in open_slave() and allocate_pty() + to match the return type of strlcpy() and the size argument of snprintf(). + * PR #81 - Fix spurious "_FORTIFY_SOURCE requires compiling with + optimization" warnings during configure probes when $Config{optimize} + (e.g. -Os) is separate from $Config{ccflags}. Include optimize flags in + all configure probe compilations. + * PR #84 - Fix header probes in Makefile.PL missing platform extension + defines (_GNU_SOURCE, _BSD_VISIBLE, etc.) that function probes already + included. Bare #includes could cause HAVE_PTY_H and similar to be unset + on strict POSIX systems even when the header exists. + Improvements: + * PR #86 - Use L<> instead of C<> for cross-module POD references in + Tty.pm and Pty.pm so MetaCPAN renders IO::Pty, IO::Handle, and IO::Stty + as clickable links. + Maintenance: + * PR #70 - Modernize POD in Tty.pm and Pty.pm: remove stale platform + version references (FreeBSD 4.4, OpenBSD 2.8, HPUX 10.20, Solaris 2.6), + replace defunct SourceForge/mailing list URLs with GitHub issue tracker. + * PR #73 - Modernize the try example script: add strict/warnings, my + declarations, 3-arg open, and lexical filehandles. The script is shipped + to CPAN and referenced in POD as the canonical usage example. + * PR #75 - Strengthen test coverage for set_raw() and winsize: verify all + termios flags set by cfmakeraw (iflag, oflag, PARENB, CSIZE, CS8, VMIN, + VTIME) and add a test for the unpack_winsize() length-validation croak. + * PR #85 - Update GitHub Actions to Node.js 24 versions: actions/checkout + v6, cross-platform-actions/action v1, perl-actions/install-with-cpm v2. + Required before GitHub forces Node.js 24 in June 2026. + +------------------------------------------------------------------- Old: ---- IO-Tty-1.27.tar.gz New: ---- IO-Tty-1.29.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-IO-Tty.spec ++++++ --- /var/tmp/diff_new_pack.e7Gwuc/_old 2026-05-20 15:23:51.300494203 +0200 +++ /var/tmp/diff_new_pack.e7Gwuc/_new 2026-05-20 15:23:51.304494367 +0200 @@ -18,10 +18,10 @@ %define cpan_name IO-Tty Name: perl-IO-Tty -Version: 1.270.0 +Version: 1.290.0 Release: 0 -# 1.27 -> normalize -> 1.270.0 -%define cpan_version 1.27 +# 1.29 -> normalize -> 1.290.0 +%define cpan_version 1.29 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Pseudo ttys and constants URL: https://metacpan.org/release/%{cpan_name} @@ -36,34 +36,24 @@ %{perl_requires} %description -'IO::Tty' is used internally by 'IO::Pty' to create a pseudo-tty. You -wouldn't want to use it directly except to import constants, use 'IO::Pty'. +'IO::Tty' is used internally by IO::Pty to create a pseudo-tty. You +wouldn't want to use it directly except to import constants, use IO::Pty. For a list of importable constants, see IO::Tty::Constant. -Windows is now supported, but ONLY under the Cygwin environment, see -http://sources.redhat.com/cygwin/. +Windows is now supported under the Cygwin environment, see +http://cygwin.com/. -Please note that pty creation is very system-dependend. From my experience, -any modern POSIX system should be fine. Find below a list of systems that -'IO::Tty' should work on. A more detailed table (which is slowly getting -out-of-date) is available from the project pages document manager at -SourceForge http://sourceforge.net/projects/expectperl/. - -If you have problems on your system and your system is listed in the -"verified" list, you probably have some non-standard setup, e.g. you -compiled your Linux-kernel yourself and disabled ptys (bummer!). Please ask -your friendly sysadmin for help. +Please note that pty creation is very system-dependent. Any modern POSIX +system should be fine. The test suite is run via GitHub Actions CI on +Linux, macOS, FreeBSD, OpenBSD, and NetBSD. + +If you have problems on your system and it is listed below, you probably +have a non-standard setup, e.g. you compiled your Linux-kernel yourself and +disabled ptys (bummer!). Please ask your friendly sysadmin for help. If your system is not listed, unpack the latest version of 'IO::Tty', do a -''perl Makefile.PL; make; make test; uname -a'' and send me -([email protected]_) the results and I'll see what I can deduce from that. -There are chances that it will work right out-of-the-box... - -If it's working on your system, please send me a short note with details -(version number, distribution, etc. 'uname -a' and 'perl -V' is a good -start; also, the output from "perl Makefile.PL" contains a lot of -interesting info, so please include that as well) so I can get an overview. -Thanks! +''perl Makefile.PL; make; make test; uname -a'' and report issues at +https://github.com/cpan-authors/IO-Tty/issues. %prep %autosetup -n %{cpan_name}-%{cpan_version} -p1 ++++++ IO-Tty-1.27.tar.gz -> IO-Tty-1.29.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/ChangeLog new/IO-Tty-1.29/ChangeLog --- old/IO-Tty-1.27/ChangeLog 2026-04-03 23:27:04.000000000 +0200 +++ new/IO-Tty-1.29/ChangeLog 2026-04-23 15:34:58.564157856 +0200 @@ -1,3 +1,77 @@ +1.29 2026-04-23 Todd Rinaldo <[email protected]> + + Bug Fixes: + * GH #87, PR #88 - Fix configure-time function detection probes being + broken by compiler optimization. The probes stored function pointers + in local variables which -O2/-Os (added to probe flags in PR #81) + eliminated as dead stores, so the linker never saw the function + reference. On systems where openpty() lives in -lutil (older glibc, + BSDs), the probe falsely succeeded without -lutil, producing + "undefined symbol: openpty" at runtime. Fixed by storing the + function pointer in a file-scope global variable which the optimizer + cannot eliminate. + + Maintenance: + * PR #89 - Add Ubuntu LTS version matrix (20.04, 22.04, 24.04) to the + GitHub Actions test suite. Exercises the system perl on each current + Ubuntu LTS release via Docker containers, running after the main + ubuntu job. + +1.28 2026-04-23 Todd Rinaldo <[email protected]> + + Bug Fixes: + * PR #69 - Fix make_slave_controlling_terminal() on Solaris/HP-UX to use + _open_tty() instead of IO::Tty->open(), ensuring STREAMS modules (ptem, + ldterm, ttcompat) are pushed via I_PUSH when the slave is opened for + controlling terminal setup. Parallel fix to the slave() method fix in + 1.24. + * PR #74 - Fix Perl 5.40+ "Possible memory corruption: ioctl overflowed + 3rd argument" warning in clone_winsize_from() and get_winsize(). Use + pack_winsize(0,0,0,0) to pre-allocate the ioctl buffer with SvCUR + matching sizeof(struct winsize) instead of an empty string. + * PR #76, PR #79 - Fix diagnostic warnings being silently suppressed when + callers use lexical "use warnings" (the modern standard since Perl 5.6). + $^W and PL_dowarn only fire under perl -w; replaced with + warnings::enabled() in IO::Tty and IO::Pty (PR #76) and ckWARN(WARN_IO) + in Tty.xs (PR #79). + * PR #77 - Fix file descriptor leak in IO::Pty when new_from_fd() fails + after pty_allocate() or _open_tty() returns raw C-level fds. Added + POSIX::close() calls on the raw fds before croaking at three sites in + new() and slave(). + * PR #78 - Fix openpty() detection on Alpine Linux and other musl-based + systems where openpty() has moved from libutil into libc (glibc 2.34+). + Probe libc first before falling back to -lutil. + * PR #80 - Fix -Wsign-compare compiler warnings: change namebuflen + parameter type from int to size_t in open_slave() and allocate_pty() + to match the return type of strlcpy() and the size argument of snprintf(). + * PR #81 - Fix spurious "_FORTIFY_SOURCE requires compiling with + optimization" warnings during configure probes when $Config{optimize} + (e.g. -Os) is separate from $Config{ccflags}. Include optimize flags in + all configure probe compilations. + * PR #84 - Fix header probes in Makefile.PL missing platform extension + defines (_GNU_SOURCE, _BSD_VISIBLE, etc.) that function probes already + included. Bare #includes could cause HAVE_PTY_H and similar to be unset + on strict POSIX systems even when the header exists. + + Improvements: + * PR #86 - Use L<> instead of C<> for cross-module POD references in + Tty.pm and Pty.pm so MetaCPAN renders IO::Pty, IO::Handle, and IO::Stty + as clickable links. + + Maintenance: + * PR #70 - Modernize POD in Tty.pm and Pty.pm: remove stale platform + version references (FreeBSD 4.4, OpenBSD 2.8, HPUX 10.20, Solaris 2.6), + replace defunct SourceForge/mailing list URLs with GitHub issue tracker. + * PR #73 - Modernize the try example script: add strict/warnings, my + declarations, 3-arg open, and lexical filehandles. The script is shipped + to CPAN and referenced in POD as the canonical usage example. + * PR #75 - Strengthen test coverage for set_raw() and winsize: verify all + termios flags set by cfmakeraw (iflag, oflag, PARENB, CSIZE, CS8, VMIN, + VTIME) and add a test for the unpack_winsize() length-validation croak. + * PR #85 - Update GitHub Actions to Node.js 24 versions: actions/checkout + v6, cross-platform-actions/action v1, perl-actions/install-with-cpm v2. + Required before GitHub forces Node.js 24 in June 2026. + 1.27 2026-04-03 Todd Rinaldo <[email protected]> Bug Fixes: @@ -32,7 +106,6 @@ Extract version from Tty.pm in Makefile.PL using MM->parse_version() instead of hardcoding it, use VERSION_FROM in WriteMakefile, and remove $XS_VERSION from Tty.pm. - 1.24 2026-03-27 Todd Rinaldo <[email protected]> Bug Fixes: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/MANIFEST.SKIP new/IO-Tty-1.29/MANIFEST.SKIP --- old/IO-Tty-1.27/MANIFEST.SKIP 2026-03-22 21:55:57.000000000 +0100 +++ new/IO-Tty-1.29/MANIFEST.SKIP 2026-04-23 11:54:22.000000000 +0200 @@ -10,3 +10,4 @@ ^IO-Tty-\d ^IO-Tty\.ppd$ ^cpanfile$ +^CLAUDE\.md$ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/META.json new/IO-Tty-1.29/META.json --- old/IO-Tty-1.27/META.json 2026-04-03 23:30:04.000000000 +0200 +++ new/IO-Tty-1.29/META.json 2026-04-23 15:53:11.000000000 +0200 @@ -55,6 +55,6 @@ "web" : "https://github.com/cpan-authors/IO-Tty" } }, - "version" : "1.27", + "version" : "1.29", "x_serialization_backend" : "JSON::PP version 4.16" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/META.yml new/IO-Tty-1.29/META.yml --- old/IO-Tty-1.27/META.yml 2026-04-03 23:30:04.000000000 +0200 +++ new/IO-Tty-1.29/META.yml 2026-04-23 15:53:10.000000000 +0200 @@ -24,5 +24,5 @@ bugtracker: https://github.com/cpan-authors/IO-Tty/issues license: http://dev.perl.org/licenses/ repository: https://github.com/cpan-authors/IO-Tty.git -version: '1.27' +version: '1.29' x_serialization_backend: 'CPAN::Meta::YAML version 0.020' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/Makefile.PL new/IO-Tty-1.29/Makefile.PL --- old/IO-Tty-1.27/Makefile.PL 2026-04-03 01:20:33.000000000 +0200 +++ new/IO-Tty-1.29/Makefile.PL 2026-04-23 15:19:00.000000000 +0200 @@ -14,22 +14,22 @@ use Config qw(%Config); my %cfg; -@cfg{qw(cc ccflags ldflags)} = @Config{qw(cc ccflags ldflags)}; +@cfg{qw(cc ccflags optimize ldflags)} = @Config{qw(cc ccflags optimize ldflags)}; for my $arg (@ARGV) { - if ( $arg =~ /^(CC|CCFLAGS|LDFLAGS)=(.*)/i ) { + if ( $arg =~ /^(CC|CCFLAGS|OPTIMIZE|LDFLAGS)=(.*)/i ) { $cfg{lc($1)} = $2; } } if ($ENV{PERL_MM_OPT}) { # Split on whitespace just like EU::MM for ( split ' ', $ENV{PERL_MM_OPT} ) { - if ( /^(CC|CCFLAGS|LDFLAGS)=(.*)/i ) { + if ( /^(CC|CCFLAGS|OPTIMIZE|LDFLAGS)=(.*)/i ) { $cfg{lc($1)} = $2; } } } -my $flags = "$cfg{ccflags} $cfg{ldflags}"; +my $flags = "$cfg{ccflags} $cfg{optimize} $cfg{ldflags}"; $flags =~ s/([^A-Za-z0-9 -_])/\\$1/g; # escape shell-metachars $|=1; # to see output immediately @@ -84,51 +84,10 @@ my $dir = getcwd; chdir('conf') or die "chdir: $!"; -open(TST,">compilerok.c") or die "open: $!"; -print TST <<'ESQ'; -int main () { return 0; } -ESQ -close(TST); - -if (system("$cfg{'cc'} $flags compilerok.c > compilerok.log 2>&1")) { - die <<"__EOT__"; - -ERROR: cannot run the configured compiler '$cfg{'cc'}' -(see conf/compilerok.log). Suggestions: -1) The compiler '$cfg{'cc'}' is not in your PATH. Add it - to the PATH and try again. OR -2) The compiler isn't installed on your system. Install it. OR -3) You only have a different compiler installed (e.g. 'gcc'). - Either fix the compiler config in the perl Config.pm - or install a perl that was built with the right compiler - (you could build perl yourself with the available compiler). - -Note: this is a system-administration issue, please ask your local -admin for help. Thank you. - -__EOT__ -} - -unlink qw(compilerok.c compilerok.log); - -# checking for various functions - -my %funcs = (ttyname => "", - openpty => "-lutil", - _getpty => "", - strlcpy => "", - sigaction => "", - grantpt => "", - unlockpt => "", - getpt => "", - posix_openpt => "", - ptsname => "", - ptsname_r => "", - ); - -foreach my $f (sort keys %funcs) { - open(TST,">functest_$f.c") or die "open: $!"; - print TST <<"ESQ"; +# Platform extension defines shared by function and header probes. +# Without these, headers like pty.h or functions like openpty may not +# be visible on strict POSIX systems or certain BSDs. +my $platform_defines = <<'PLATDEFS'; /* Enable POSIX and platform extensions so functions like grantpt, ptsname, openpty etc. are declared in standard headers. */ #ifndef _GNU_SOURCE @@ -170,7 +129,54 @@ #define _BSD_SOURCE #endif #endif +PLATDEFS + +open(TST,">compilerok.c") or die "open: $!"; +print TST <<'ESQ'; +int main () { return 0; } +ESQ +close(TST); + +if (system("$cfg{'cc'} $flags compilerok.c > compilerok.log 2>&1")) { + die <<"__EOT__"; + +ERROR: cannot run the configured compiler '$cfg{'cc'}' +(see conf/compilerok.log). Suggestions: +1) The compiler '$cfg{'cc'}' is not in your PATH. Add it + to the PATH and try again. OR +2) The compiler isn't installed on your system. Install it. OR +3) You only have a different compiler installed (e.g. 'gcc'). + Either fix the compiler config in the perl Config.pm + or install a perl that was built with the right compiler + (you could build perl yourself with the available compiler). + +Note: this is a system-administration issue, please ask your local +admin for help. Thank you. + +__EOT__ +} + +unlink qw(compilerok.c compilerok.log); + +# checking for various functions + +my %funcs = (ttyname => [""], + openpty => ["", "-lutil"], + _getpty => [""], + strlcpy => [""], + sigaction => [""], + grantpt => [""], + unlockpt => [""], + getpt => [""], + posix_openpt => [""], + ptsname => [""], + ptsname_r => [""], + ); +foreach my $f (sort keys %funcs) { + open(TST,">functest_$f.c") or die "open: $!"; + print TST <<"ESQ"; +$platform_defines #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -194,6 +200,11 @@ # endif #endif +/* Store the function pointer in a global so the optimizer cannot + eliminate the reference. A local + (void)cast is dead code that + -O2/-Os removes, causing the linker to miss undefined symbols. */ +void *functest_ptr; + int main () { @@ -203,13 +214,8 @@ #if defined (__stub_$f) || defined (__stub___$f) choke me #else -/* Undef any macro wrapper (e.g. macOS _FORTIFY_SOURCE) so we get - the real function symbol for the linker check below. */ #undef $f -/* Cast through void* to avoid incompatible-function-pointer-types - errors on newer clang (e.g. strlcpy returns size_t, not void). */ -void *fptr = (void *) $f; -(void)fptr; +functest_ptr = (void *) $f; #endif ; @@ -219,13 +225,24 @@ close(TST); print "Looking for $f()" . "." x (13-length($f)) . " "; - if (system("$cfg{'cc'} $flags $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) { - print "not found.\n"; - } else { - $define{"-DHAVE_\U$f"} = undef; - push @libs, $funcs{$f} if $funcs{$f}; + + # Try each library candidate in order (e.g. openpty is in libc on + # glibc 2.34+/musl, but needs -lutil on BSDs and older glibc). + my @lib_candidates = @{$funcs{$f}}; + my $found = 0; + for my $try_lib (@lib_candidates) { + unless (system("$cfg{'cc'} $flags $try_lib functest_$f.c > functest_$f.log 2>&1")) { + $define{"-DHAVE_\U$f"} = undef; + push @libs, $try_lib if $try_lib; + $found = 1; + last; + } + } + if ($found) { print "FOUND.\n"; - unlink "functest_$f.c", "functest_$f.log" ; + unlink "functest_$f.c", "functest_$f.log"; + } else { + print "not found.\n"; } } @@ -240,6 +257,7 @@ $def =~ s/\W/_/g; open(TST,">headtest_$def.c") or die "open: $!"; print TST <<"ESQ"; +$platform_defines #include <sys/types.h> #include <$h> int main () { return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/Pty.pm new/IO-Tty-1.29/Pty.pm --- old/IO-Tty-1.27/Pty.pm 2026-04-03 23:27:09.000000000 +0200 +++ new/IO-Tty-1.29/Pty.pm 2026-04-23 15:35:29.408676243 +0200 @@ -10,7 +10,7 @@ require POSIX; our @ISA = qw(IO::Handle); -our $VERSION = '1.27'; # keep same as in Tty.pm +our $VERSION = '1.29'; # keep same as in Tty.pm eval { local $^W = 0; local $SIG{__DIE__}; require IO::Stty }; push @ISA, "IO::Stty" if ( not $@ ); # if IO::Stty is installed @@ -24,12 +24,19 @@ croak "Cannot open a pty" if not defined $ptyfd; my $pty = $class->SUPER::new_from_fd( $ptyfd, "r+" ); - croak "Cannot create a new $class from fd $ptyfd: $!" if not $pty; + if (not $pty) { + POSIX::close($ptyfd); + POSIX::close($ttyfd); + croak "Cannot create a new $class from fd $ptyfd: $!"; + } $pty->autoflush(1); bless $pty => $class; my $slave = IO::Tty->new_from_fd( $ttyfd, "r+" ); - croak "Cannot create a new IO::Tty from fd $ttyfd: $!" if not $slave; + if (not $slave) { + POSIX::close($ttyfd); + croak "Cannot create a new IO::Tty from fd $ttyfd: $!"; + } $slave->autoflush(1); ${*$pty}{'io_pty_slave'} = $slave; @@ -71,7 +78,10 @@ croak "Cannot open slave $tty: $!" if $slave_fd < 0; my $slave = IO::Tty->new_from_fd( $slave_fd, "r+" ); - croak "Cannot create IO::Tty from fd $slave_fd: $!" if not $slave; + if (not $slave) { + POSIX::close($slave_fd); + croak "Cannot create IO::Tty from fd $slave_fd: $!"; + } $slave->autoflush(1); ${*$slave}{'io_tty_ttyname'} = $tty; @@ -86,7 +96,7 @@ my $self = shift; local (*DEVTTY); - # loose controlling terminal explicitly + # lose controlling terminal explicitly if ( defined TIOCNOTTY ) { if ( open( \*DEVTTY, "/dev/tty" ) ) { ioctl( \*DEVTTY, TIOCNOTTY, 0 ); @@ -96,19 +106,23 @@ # Create a new 'session', lose controlling terminal. if ( POSIX::setsid() == -1 ) { - warn "setsid() failed, strange behavior may result: $!\r\n" if $^W; + warn "setsid() failed, strange behavior may result: $!\r\n"; } if ( open( \*DEVTTY, "/dev/tty" ) ) { - warn "Could not disconnect from controlling terminal?!\n" if $^W; + warn "Could not disconnect from controlling terminal?!\n"; close \*DEVTTY; } # now open slave, this should set it as controlling tty on some systems - my $ttyname = ${*$self}{'io_pty_ttyname'}; - my $slv = IO::Tty->new; - $slv->open( $ttyname, O_RDWR ) - or croak "Cannot open slave $ttyname: $!"; + # Use _open_tty() to ensure STREAMS modules (ptem, ldterm, ttcompat) + # are pushed on Solaris/HP-UX, matching the slave() method. + my $ttyname = ${*$self}{'io_pty_ttyname'}; + my $slave_fd = IO::Tty::_open_tty($ttyname); + croak "Cannot open slave $ttyname: $!" if $slave_fd < 0; + my $slv = IO::Tty->new_from_fd( $slave_fd, "r+" ); + croak "Cannot create IO::Tty from fd $slave_fd: $!" if not $slv; + $slv->autoflush(1); if ( not exists ${*$self}{'io_pty_slave'} ) { ${*$self}{'io_pty_slave'} = $slv; @@ -121,16 +135,16 @@ if ( not open( \*DEVTTY, "/dev/tty" ) ) { if ( defined TIOCSCTTY ) { if ( not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 ) ) { - warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!"; } } elsif ( defined TCSETCTTY ) { if ( not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 ) ) { - warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; + warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!"; } } else { - warn "warning: You have neither TIOCSCTTY nor TCSETCTTY on your system\n" if $^W; + warn "warning: You have neither TIOCSCTTY nor TCSETCTTY on your system\n"; return 0; } } @@ -170,7 +184,7 @@ =head1 VERSION -1.27 +1.29 =head1 SYNOPSIS @@ -193,8 +207,8 @@ C<IO::Pty> provides an interface to allow the creation of a pseudo tty. -C<IO::Pty> inherits from C<IO::Handle> and so provide all the methods -defined by the C<IO::Handle> package. +C<IO::Pty> inherits from L<IO::Handle> and so provide all the methods +defined by the L<IO::Handle> package. Please note that pty creation is very system-dependent. If you have problems, see L<IO::Tty> for help. @@ -224,7 +238,7 @@ =item slave() The C<slave> method will return the slave filehandle of the given -master pty, opening it anew if necessary. If IO::Stty is installed, +master pty, opening it anew if necessary. If L<IO::Stty> is installed, you can then call C<$slave-E<gt>stty()> to modify the terminal settings. =item close_slave() @@ -245,7 +259,7 @@ =item set_raw() Will set the pty to raw. Note that this is a one-way operation, you -need IO::Stty to set the terminal settings to anything else. +need L<IO::Stty> to set the terminal settings to anything else. On some systems, the master pty is not a tty. This method checks for that and returns success anyway on such systems. Note that this @@ -289,18 +303,8 @@ L<IO::Tty>, L<IO::Tty::Constant>, L<IO::Handle>, L<Expect>, L<Proc::SyncExec> - -=head1 MAILING LISTS - -As this module is mainly used by Expect, support for it is available -via the two Expect mailing lists, expectperl-announce and -expectperl-discuss, at - - http://lists.sourceforge.net/lists/listinfo/expectperl-announce - -and - - http://lists.sourceforge.net/lists/listinfo/expectperl-discuss +Source code and issue tracker at +L<https://github.com/cpan-authors/IO-Tty>. =head1 AUTHORS @@ -308,10 +312,12 @@ Originally by Graham Barr E<lt>F<[email protected]>E<gt>, based on the Ptty module by Nick Ing-Simmons E<lt>F<[email protected]>E<gt>. -Now maintained and heavily rewritten by Roland Giersig +Heavily rewritten by Roland Giersig E<lt>F<[email protected]>E<gt>. -Contains copyrighted stuff from openssh v3.0p1, authored by +Currently maintained by Todd Rinaldo. + +Contains copyrighted stuff from openssh v3.0p1, authored by Tatu Ylonen <[email protected]>, Markus Friedl and Todd C. Miller <[email protected]>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/README.md new/IO-Tty-1.29/README.md --- old/IO-Tty-1.27/README.md 2026-04-03 23:27:13.000000000 +0200 +++ new/IO-Tty-1.29/README.md 2026-04-23 15:35:46.044116310 +0200 @@ -6,7 +6,7 @@ # VERSION -1.27 +1.29 # SYNOPSIS @@ -16,127 +16,80 @@ # DESCRIPTION -`IO::Tty` is used internally by `IO::Pty` to create a pseudo-tty. +`IO::Tty` is used internally by [IO::Pty](https://metacpan.org/pod/IO%3A%3APty) to create a pseudo-tty. You wouldn't want to use it directly except to import constants, use -`IO::Pty`. For a list of importable constants, see +[IO::Pty](https://metacpan.org/pod/IO%3A%3APty). For a list of importable constants, see [IO::Tty::Constant](https://metacpan.org/pod/IO%3A%3ATty%3A%3AConstant). -Windows is now supported, but ONLY under the Cygwin -environment, see [http://sources.redhat.com/cygwin/](http://sources.redhat.com/cygwin/). +Windows is now supported under the Cygwin environment, see +[http://cygwin.com/](http://cygwin.com/). -Please note that pty creation is very system-dependend. From my -experience, any modern POSIX system should be fine. Find below a list -of systems that `IO::Tty` should work on. A more detailed table -(which is slowly getting out-of-date) is available from the project -pages document manager at SourceForge -[http://sourceforge.net/projects/expectperl/](http://sourceforge.net/projects/expectperl/). - -If you have problems on your system and your system is listed in the -"verified" list, you probably have some non-standard setup, e.g. you -compiled your Linux-kernel yourself and disabled ptys (bummer!). -Please ask your friendly sysadmin for help. +Please note that pty creation is very system-dependent. Any modern +POSIX system should be fine. The test suite is run via GitHub Actions +CI on Linux, macOS, FreeBSD, OpenBSD, and NetBSD. + +If you have problems on your system and it is listed below, you +probably have a non-standard setup, e.g. you compiled your +Linux-kernel yourself and disabled ptys (bummer!). Please ask your +friendly sysadmin for help. If your system is not listed, unpack the latest version of `IO::Tty`, -do a `'perl Makefile.PL; make; make test; uname -a'` and send me -(`[email protected]`) the results and I'll see what I can deduce from -that. There are chances that it will work right out-of-the-box... - -If it's working on your system, please send me a short note with -details (version number, distribution, etc. 'uname -a' and 'perl -V' -is a good start; also, the output from "perl Makefile.PL" contains a -lot of interesting info, so please include that as well) so I can get -an overview. Thanks! +do a `'perl Makefile.PL; make; make test; uname -a'` and report +issues at [https://github.com/cpan-authors/IO-Tty/issues](https://github.com/cpan-authors/IO-Tty/issues). -# VERIFIED SYSTEMS, KNOWN ISSUES +# PLATFORMS AND KNOWN ISSUES -This is a list of systems that `IO::Tty` seems to work on ('make -test' passes) with comments about "features": +`IO::Tty` is tested via CI on Linux, macOS, FreeBSD, OpenBSD, and +NetBSD across multiple Perl versions. It is also known to work on +AIX, Solaris/illumos, HP-UX, IRIX, z/OS, and Windows (under Cygwin). -- AIX 4.3 +Known platform-specific behaviors: + +- Linux, AIX Returns EIO instead of EOF when the slave is closed. Benign. -- AIX 5.x -- FreeBSD 4.4 +- FreeBSD, OpenBSD, HP-UX, Solaris EOF on the slave tty is not reported back to the master. -- OpenBSD 2.8 +- OpenBSD The ioctl TIOCSCTTY sometimes fails. This is also known in - Tcl/Expect, see http://expect.nist.gov/FAQ.html - - EOF on the slave tty is not reported back to the master. - -- Darwin 7.9.0 -- HPUX 10.20 & 11.00 - - EOF on the slave tty is not reported back to the master. - -- IRIX 6.5 -- Linux 2.2.x & 2.4.x - - Returns EIO instead of EOF when the slave is closed. Benign. - -- OSF 4.0 - - EOF on the slave tty is not reported back to the master. - -- Solaris 8, 2.7, 2.6 + Tcl/Expect. - Has the "feature" of returning EOF just once?! +- Solaris - EOF on the slave tty is not reported back to the master. + Has the "feature" of returning EOF just once. -- Windows NT/2k/XP (under Cygwin) +- Cygwin When you send (print) a too long line (>160 chars) to a non-raw pty, the call just hangs forever and even alarm() cannot get you out. - Don't complain to me... - - EOF on the slave tty is not reported back to the master. - -- z/OS -The following systems have not been verified yet for this version, but -a previous version worked on them: - -- SCO Unix -- NetBSD - - probably the same as the other \*BSDs... - -If you have additions to these lists, please mail them to -<`[email protected]`>. +Please report issues at +[https://github.com/cpan-authors/IO-Tty/issues](https://github.com/cpan-authors/IO-Tty/issues). # SEE ALSO [IO::Pty](https://metacpan.org/pod/IO%3A%3APty), [IO::Tty::Constant](https://metacpan.org/pod/IO%3A%3ATty%3A%3AConstant) -# MAILING LISTS - -As this module is mainly used by Expect, support for it is available -via the two Expect mailing lists, expectperl-announce and -expectperl-discuss, at - - http://lists.sourceforge.net/lists/listinfo/expectperl-announce - -and - - http://lists.sourceforge.net/lists/listinfo/expectperl-discuss +Source code and issue tracker at +[https://github.com/cpan-authors/IO-Tty](https://github.com/cpan-authors/IO-Tty). # AUTHORS Originally by Graham Barr <`[email protected]`>, based on the Ptty module by Nick Ing-Simmons <`[email protected]`>. -Now maintained and heavily rewritten by Roland Giersig +Heavily rewritten by Roland Giersig <`[email protected]`>. +Currently maintained by Todd Rinaldo. + Contains copyrighted stuff from openssh v3.0p1, authored by Tatu Ylonen <[email protected]>, Markus Friedl and Todd C. Miller -<[email protected]>. I also got a lot of inspiration from -the pty code in Xemacs. +<[email protected]>. # COPYRIGHT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/Tty.pm new/IO-Tty-1.29/Tty.pm --- old/IO-Tty-1.27/Tty.pm 2026-04-03 23:27:07.000000000 +0200 +++ new/IO-Tty-1.29/Tty.pm 2026-04-23 15:35:11.541166877 +0200 @@ -15,7 +15,7 @@ require POSIX; our @ISA = qw(IO::Handle); -our $VERSION = '1.27'; +our $VERSION = '1.29'; our ( $CONFIG, $DEBUG ); eval { local $^W = 0; local $SIG{__DIE__}; require IO::Stty }; @@ -44,22 +44,21 @@ croak "Given filehandle is not a tty in clone_winsize_from, called" if not POSIX::isatty($fh); return 1 if not POSIX::isatty($self); # ignored for master ptys - my $winsize = " " x 1024; # preallocate memory for older perl versions - $winsize = ''; # But leave the SV as empty + my $winsize = IO::Tty::pack_winsize( 0, 0, 0, 0 ); ioctl( $fh, &IO::Tty::Constant::TIOCGWINSZ, $winsize ) and ioctl( $self, &IO::Tty::Constant::TIOCSWINSZ, $winsize ) and return 1; - warn "clone_winsize_from: error: $!" if $^W; + carp "clone_winsize_from: error: $!"; return undef; } -# ioctl() doesn't tell us how long the structure is, so we'll have to trim it -# after TIOCGWINSZ +# ioctl() may pad the buffer beyond sizeof(struct winsize), +# so trim it before passing to unpack_winsize. my $SIZEOF_WINSIZE = length IO::Tty::pack_winsize( 0, 0, 0, 0 ); sub get_winsize { my $self = shift; - my $winsize = " " x 1024; # preallocate memory + my $winsize = IO::Tty::pack_winsize( 0, 0, 0, 0 ); ioctl( $self, IO::Tty::Constant::TIOCGWINSZ(), $winsize ) or croak "Cannot TIOCGWINSZ - $!"; substr( $winsize, $SIZEOF_WINSIZE ) = ""; @@ -115,7 +114,7 @@ =head1 VERSION -1.27 +1.29 =head1 SYNOPSIS @@ -125,129 +124,72 @@ =head1 DESCRIPTION -C<IO::Tty> is used internally by C<IO::Pty> to create a pseudo-tty. +C<IO::Tty> is used internally by L<IO::Pty> to create a pseudo-tty. You wouldn't want to use it directly except to import constants, use -C<IO::Pty>. For a list of importable constants, see +L<IO::Pty>. For a list of importable constants, see L<IO::Tty::Constant>. -Windows is now supported, but ONLY under the Cygwin -environment, see L<http://sources.redhat.com/cygwin/>. +Windows is now supported under the Cygwin environment, see +L<http://cygwin.com/>. -Please note that pty creation is very system-dependend. From my -experience, any modern POSIX system should be fine. Find below a list -of systems that C<IO::Tty> should work on. A more detailed table -(which is slowly getting out-of-date) is available from the project -pages document manager at SourceForge -L<http://sourceforge.net/projects/expectperl/>. - -If you have problems on your system and your system is listed in the -"verified" list, you probably have some non-standard setup, e.g. you -compiled your Linux-kernel yourself and disabled ptys (bummer!). -Please ask your friendly sysadmin for help. +Please note that pty creation is very system-dependent. Any modern +POSIX system should be fine. The test suite is run via GitHub Actions +CI on Linux, macOS, FreeBSD, OpenBSD, and NetBSD. + +If you have problems on your system and it is listed below, you +probably have a non-standard setup, e.g. you compiled your +Linux-kernel yourself and disabled ptys (bummer!). Please ask your +friendly sysadmin for help. If your system is not listed, unpack the latest version of C<IO::Tty>, -do a C<'perl Makefile.PL; make; make test; uname -a'> and send me -(F<[email protected]>) the results and I'll see what I can deduce from -that. There are chances that it will work right out-of-the-box... +do a C<'perl Makefile.PL; make; make test; uname -a'> and report +issues at L<https://github.com/cpan-authors/IO-Tty/issues>. -If it's working on your system, please send me a short note with -details (version number, distribution, etc. 'uname -a' and 'perl -V' -is a good start; also, the output from "perl Makefile.PL" contains a -lot of interesting info, so please include that as well) so I can get -an overview. Thanks! +=head1 PLATFORMS AND KNOWN ISSUES -=head1 VERIFIED SYSTEMS, KNOWN ISSUES +C<IO::Tty> is tested via CI on Linux, macOS, FreeBSD, OpenBSD, and +NetBSD across multiple Perl versions. It is also known to work on +AIX, Solaris/illumos, HP-UX, IRIX, z/OS, and Windows (under Cygwin). -This is a list of systems that C<IO::Tty> seems to work on ('make -test' passes) with comments about "features": +Known platform-specific behaviors: =over 4 -=item * AIX 4.3 +=item * Linux, AIX Returns EIO instead of EOF when the slave is closed. Benign. -=item * AIX 5.x - -=item * FreeBSD 4.4 +=item * FreeBSD, OpenBSD, HP-UX, Solaris EOF on the slave tty is not reported back to the master. -=item * OpenBSD 2.8 +=item * OpenBSD The ioctl TIOCSCTTY sometimes fails. This is also known in -Tcl/Expect, see http://expect.nist.gov/FAQ.html - -EOF on the slave tty is not reported back to the master. +Tcl/Expect. -=item * Darwin 7.9.0 +=item * Solaris -=item * HPUX 10.20 & 11.00 - -EOF on the slave tty is not reported back to the master. - -=item * IRIX 6.5 - -=item * Linux 2.2.x & 2.4.x - -Returns EIO instead of EOF when the slave is closed. Benign. +Has the "feature" of returning EOF just once. -=item * OSF 4.0 - -EOF on the slave tty is not reported back to the master. - -=item * Solaris 8, 2.7, 2.6 - -Has the "feature" of returning EOF just once?! - -EOF on the slave tty is not reported back to the master. - -=item * Windows NT/2k/XP (under Cygwin) +=item * Cygwin When you send (print) a too long line (>160 chars) to a non-raw pty, the call just hangs forever and even alarm() cannot get you out. -Don't complain to me... - -EOF on the slave tty is not reported back to the master. - -=item * z/OS =back -The following systems have not been verified yet for this version, but -a previous version worked on them: - -=over 4 - -=item * SCO Unix - -=item * NetBSD - -probably the same as the other *BSDs... - -=back - -If you have additions to these lists, please mail them to -E<lt>F<[email protected]>E<gt>. +Please report issues at +L<https://github.com/cpan-authors/IO-Tty/issues>. =head1 SEE ALSO L<IO::Pty>, L<IO::Tty::Constant> - -=head1 MAILING LISTS - -As this module is mainly used by Expect, support for it is available -via the two Expect mailing lists, expectperl-announce and -expectperl-discuss, at - - http://lists.sourceforge.net/lists/listinfo/expectperl-announce - -and - - http://lists.sourceforge.net/lists/listinfo/expectperl-discuss +Source code and issue tracker at +L<https://github.com/cpan-authors/IO-Tty>. =head1 AUTHORS @@ -255,13 +197,14 @@ Originally by Graham Barr E<lt>F<[email protected]>E<gt>, based on the Ptty module by Nick Ing-Simmons E<lt>F<[email protected]>E<gt>. -Now maintained and heavily rewritten by Roland Giersig +Heavily rewritten by Roland Giersig E<lt>F<[email protected]>E<gt>. +Currently maintained by Todd Rinaldo. + Contains copyrighted stuff from openssh v3.0p1, authored by Tatu Ylonen <[email protected]>, Markus Friedl and Todd C. Miller -<[email protected]>. I also got a lot of inspiration from -the pty code in Xemacs. +<[email protected]>. =head1 COPYRIGHT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/Tty.xs new/IO-Tty-1.29/Tty.xs --- old/IO-Tty-1.27/Tty.xs 2026-04-02 17:58:45.000000000 +0200 +++ new/IO-Tty-1.29/Tty.xs 2026-04-23 11:54:03.000000000 +0200 @@ -212,7 +212,7 @@ int newfd; newfd = fcntl(*fd, F_DUPFD, 3); if (newfd < 0) { - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::pty_allocate(nonfatal): tried to move fd %d up but fcntl() said %.100s", *fd, strerror(errno)); } else { close (*fd); @@ -231,7 +231,7 @@ #endif static int -open_slave(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) +open_slave(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) { /* * now do some things that are supposedly healthy for ptys, @@ -247,7 +247,7 @@ fprintf(stderr, "trying grantpt()...\n"); #endif if (grantpt(*ptyfd) < 0) { - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::pty_allocate(nonfatal): grantpt(): %.100s", strerror(errno)); } @@ -258,7 +258,7 @@ fprintf(stderr, "trying unlockpt()...\n"); #endif if (unlockpt(*ptyfd) < 0) { - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::pty_allocate(nonfatal): unlockpt(): %.100s", strerror(errno)); } #endif /* HAVE_UNLOCKPT */ @@ -278,7 +278,7 @@ fprintf(stderr, "trying ptsname_r()...\n"); #endif if(ptsname_r(*ptyfd, namebuf, namebuflen)) { - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::open_slave(nonfatal): ptsname_r(): %.100s", strerror(errno)); } } @@ -300,7 +300,7 @@ return 0; } } else { - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::open_slave(nonfatal): ptsname(): %.100s", strerror(errno)); } } @@ -367,7 +367,7 @@ *ttyfd = open(namebuf, O_RDWR | O_NOCTTY); if (*ttyfd < 0) { - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::open_slave(nonfatal): open(%.200s): %.100s", namebuf, strerror(errno)); close(*ptyfd); @@ -388,7 +388,7 @@ #endif if (ioctl(*ttyfd, I_PUSH, "ptem") < 0) #if defined (__solaris) || defined(__hpux) - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::pty_allocate: ioctl I_PUSH ptem: %.100s", strerror(errno)) #endif ; @@ -399,7 +399,7 @@ #endif if (ioctl(*ttyfd, I_PUSH, "ldterm") < 0) #if defined (__solaris) || defined(__hpux) - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::pty_allocate: ioctl I_PUSH ldterm: %.100s", strerror(errno)) #endif ; @@ -410,7 +410,7 @@ #endif if (ioctl(*ttyfd, I_PUSH, "ttcompat") < 0) #if defined (__solaris) - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("IO::Tty::pty_allocate: ioctl I_PUSH ttcompat: %.100s", strerror(errno)) #endif ; @@ -440,7 +440,7 @@ */ static int -allocate_pty(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) +allocate_pty(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) { *ptyfd = -1; *ttyfd = -1; @@ -477,7 +477,7 @@ break; /* open_slave closes *ptyfd on failure */ } else { - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): _getpty(): %.100s", strerror(errno)); *ptyfd = -1; } @@ -495,7 +495,7 @@ *ptyfd = posix_openpt(O_RDWR|O_NOCTTY); if (*ptyfd >= 0 && open_slave(ptyfd, ttyfd, namebuf, namebuflen)) break; /* got one */ - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): posix_openpt(): %.100s", strerror(errno)); #endif /* defined(HAVE_POSIX_OPENPT) */ @@ -508,7 +508,7 @@ *ptyfd = getpt(); if (*ptyfd >= 0 && open_slave(ptyfd, ttyfd, namebuf, namebuflen)) break; /* got one */ - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): getpt(): %.100s", strerror(errno)); #endif /* defined(HAVE_GETPT) */ @@ -541,7 +541,7 @@ *ptyfd = -1; *ttyfd = -1; } - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): openpty(): %.100s", strerror(errno)); } #endif /* defined(HAVE_OPENPTY) */ @@ -559,7 +559,7 @@ *ptyfd = open("/dev/ptmx", O_RDWR | O_NOCTTY); if (*ptyfd >= 0 && open_slave(ptyfd, ttyfd, namebuf, namebuflen)) break; - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): open(/dev/ptmx): %.100s", strerror(errno)); #endif /* HAVE_DEV_PTMX */ @@ -572,7 +572,7 @@ *ptyfd = open("/dev/ptym/clone", O_RDWR | O_NOCTTY); if (*ptyfd >= 0 && open_slave(ptyfd, ttyfd, namebuf, namebuflen)) break; - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): open(/dev/ptym/clone): %.100s", strerror(errno)); #endif /* HAVE_DEV_PTYM_CLONE */ @@ -586,7 +586,7 @@ *ptyfd = open("/dev/ptc", O_RDWR | O_NOCTTY); if (*ptyfd >= 0 && open_slave(ptyfd, ttyfd, namebuf, namebuflen)) break; - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): open(/dev/ptc): %.100s", strerror(errno)); #endif /* HAVE_DEV_PTC */ @@ -598,7 +598,7 @@ *ptyfd = open("/dev/ptmx_bsd", O_RDWR | O_NOCTTY); if (*ptyfd >= 0 && open_slave(ptyfd, ttyfd, namebuf, namebuflen)) break; - if (PL_dowarn) + if (ckWARN(WARN_IO)) warn("pty_allocate(nonfatal): open(/dev/ptmx_bsd): %.100s", strerror(errno)); #endif /* HAVE_DEV_PTMX_BSD */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/t/pty_set_raw.t new/IO-Tty-1.29/t/pty_set_raw.t --- old/IO-Tty-1.27/t/pty_set_raw.t 2026-03-22 21:47:58.000000000 +0100 +++ new/IO-Tty-1.29/t/pty_set_raw.t 2026-04-23 11:54:03.000000000 +0200 @@ -7,7 +7,7 @@ use IO::Pty; use POSIX; -plan tests => 7; +plan tests => 14; my $master = IO::Pty->new; ok( $master, "IO::Pty->new succeeded" ); @@ -25,6 +25,32 @@ my $termios = POSIX::Termios->new; ok( $termios->getattr($ttyno), "getattr after set_raw" ); +# lflag: all processing flags should be off my $lflag = $termios->getlflag(); is( $lflag & POSIX::ECHO(), 0, "ECHO is off after set_raw" ); is( $lflag & POSIX::ICANON(), 0, "ICANON is off after set_raw" ); + +# iflag: should be zeroed (no input processing) +my $iflag = $termios->getiflag(); +is( $iflag, 0, "iflag is 0 after set_raw" ); + +# oflag: should be zeroed (no output processing) +my $oflag = $termios->getoflag(); +is( $oflag, 0, "oflag is 0 after set_raw" ); + +# cflag: PARENB should be cleared, CS8 should be set +my $cflag = $termios->getcflag(); +is( $cflag & POSIX::PARENB(), 0, "PARENB is off after set_raw" ); +is( $cflag & POSIX::CSIZE(), POSIX::CS8(), "CSIZE is CS8 after set_raw" ); + +# cc: VMIN=1, VTIME=0 for blocking single-byte reads +is( $termios->getcc(POSIX::VMIN()), 1, "VMIN is 1 after set_raw" ); +is( $termios->getcc(POSIX::VTIME()), 0, "VTIME is 0 after set_raw" ); + +# set_raw on master returns 1 silently when master is not a tty +SKIP: { + skip "master is a tty on this system", 1 if POSIX::isatty($master); + + my $mret = $master->set_raw(); + is( $mret, 1, "set_raw on non-tty master returns 1" ); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/t/winsize.t new/IO-Tty-1.29/t/winsize.t --- old/IO-Tty-1.27/t/winsize.t 2026-03-24 23:55:47.000000000 +0100 +++ new/IO-Tty-1.29/t/winsize.t 2026-04-23 11:54:03.000000000 +0200 @@ -10,7 +10,7 @@ # pack_winsize / unpack_winsize are XS functions, always available # set_winsize / get_winsize require the slave to be a tty -plan tests => 10; +plan tests => 14; # Test pack_winsize / unpack_winsize round-trip { @@ -34,17 +34,35 @@ is( $dims[1], 132, "col=132 round-trips" ); } +# Test unpack_winsize rejects wrong-sized input +{ + eval { IO::Tty::unpack_winsize("too short") }; + like( $@, qr/Bad arg length/, "unpack_winsize croaks on wrong-sized input" ); + + eval { IO::Tty::unpack_winsize("") }; + like( $@, qr/Bad arg length/, "unpack_winsize croaks on empty input" ); +} + +# Test pack_winsize with default pixel values (xpixel/ypixel default to 0) +{ + my $packed_explicit = IO::Tty::pack_winsize( 24, 80, 0, 0 ); + my $packed_default = IO::Tty::pack_winsize( 24, 80 ); + is( $packed_explicit, $packed_default, + "pack_winsize defaults xpixel/ypixel to 0" ); +} + # Test set_winsize / get_winsize on slave { my $pty = IO::Pty->new; my $slave = $pty->slave; SKIP: { - skip "slave is not a tty on this system", 1 + skip "slave is not a tty on this system", 2 unless POSIX::isatty($slave); $slave->set_winsize( 40, 100, 0, 0 ); my @ws = $slave->get_winsize(); - is( $ws[0], 40, "set_winsize/get_winsize round-trip on slave" ); + is( $ws[0], 40, "set_winsize/get_winsize row round-trip on slave" ); + is( $ws[1], 100, "set_winsize/get_winsize col round-trip on slave" ); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Tty-1.27/try new/IO-Tty-1.29/try --- old/IO-Tty-1.27/try 2026-03-25 00:25:25.000000000 +0100 +++ new/IO-Tty-1.29/try 2026-04-23 12:31:38.000000000 +0200 @@ -1,20 +1,23 @@ +#!/usr/bin/perl + +use strict; +use warnings; use blib; use IO::Pty; require POSIX; -$^W = 1; my $pty = IO::Pty->new; my $pid; unless (@ARGV) { - { + { my $slave = $pty->slave; print %{*$pty},"\n"; print "master $pty $$pty ",$pty->ttyname,"\n"; print "slave $slave $$slave ",$slave->ttyname,"\n"; - foreach $val (1..10) { + foreach my $val (1..10) { print $pty "$val\n"; $_ = <$slave>; print "$_"; @@ -24,39 +27,39 @@ print "Done.\n"; exit 0; } else { - pipe(STAT_RDR, STAT_WTR) + pipe(my $stat_rdr, my $stat_wtr) or die "Cannot open pipe: $!"; - STAT_WTR->autoflush(1); + $stat_wtr->autoflush(1); $pid = fork(); die "Cannot fork" if not defined $pid; unless ($pid) { - close STAT_RDR; + close $stat_rdr; $pty->make_slave_controlling_terminal(); my $slave = $pty->slave(); close $pty; $slave->clone_winsize_from(\*STDIN); $slave->set_raw(); - open(STDIN,"<&". $slave->fileno()) + open(STDIN, '<&', $slave->fileno()) or die "Couldn't reopen STDIN for reading, $!\n"; - open(STDOUT,">&". $slave->fileno()) + open(STDOUT, '>&', $slave->fileno()) or die "Couldn't reopen STDOUT for writing, $!\n"; - open(STDERR,">&". $slave->fileno()) + open(STDERR, '>&', $slave->fileno()) or die "Couldn't reopen STDERR for writing, $!\n"; close $slave; { exec(@ARGV) }; - print STAT_WTR $!+0; + print $stat_wtr $!+0; die "Cannot exec(@ARGV): $!"; } - close STAT_WTR; + close $stat_wtr; $pty->close_slave(); $pty->set_raw(); # now wait for child exec (eof due to close-on-exit) or exec error - my $errstatus = sysread(STAT_RDR, $errno, 256); + my $errstatus = sysread($stat_rdr, my $errno, 256); die "Cannot sync with child: $!" if not defined $errstatus; - close STAT_RDR; + close $stat_rdr; if ($errstatus) { $! = $errno+0; die "Cannot exec(@ARGV): $!"; @@ -72,6 +75,8 @@ $SIG{WINCH} = \&winch; } +my $log_fh; + sub process { my ($rin,$src,$dst) = @_; @@ -80,11 +85,10 @@ if (defined $read && $read) { syswrite($dst,$buf,$read); - syswrite(LOG,$buf,$read); + syswrite($log_fh,$buf,$read); } else { -# print STDERR "Nothing for $src i.e. $read\n"; vec($rin, fileno($src), 1) = 0; } return $rin; @@ -92,7 +96,7 @@ sub parent { - open(LOG,">log") || die; + open($log_fh, '>', 'log') || die "Cannot open log: $!"; my ($pty) = @_; my $tty = $pty; my ($rin,$win,$ein) = ('','',''); @@ -107,26 +111,23 @@ while (1) { my ($rout,$wout,$eout,$timeleft); - ($nfound,$timeleft) = select($rout=$rin,$wout=$win,$eout=$ein,3600); + (my $nfound,$timeleft) = select($rout=$rin,$wout=$win,$eout=$ein,3600); die "select failed:$!" if ($nfound < 0); if ($nfound > 0) { if (vec($eout, fileno($tty), 1)) { -# print STDERR "Exception on $tty\n"; } if (vec($rout, fileno($tty), 1)) { - $rin = process($rin,$tty,STDOUT); + $rin = process($rin,$tty,\*STDOUT); last unless (vec($rin, fileno($tty), 1)); } elsif (vec($rout, fileno(STDIN), 1) && vec($wout, fileno($tty), 1)) { - $rin = process($rin,STDIN,$tty); + $rin = process($rin,\*STDIN,$tty); } } } - close(LOG); + close($log_fh); } - - ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.e7Gwuc/_old 2026-05-20 15:23:51.472501277 +0200 +++ /var/tmp/diff_new_pack.e7Gwuc/_new 2026-05-20 15:23:51.476501442 +0200 @@ -1,6 +1,6 @@ -mtime: 1775735750 -commit: 1b82bb0c888e9f8e3117c12429cfb6a39b4742eec348ac50f0778e3b081ea6aa -url: https://src.opensuse.org/perl/perl-IO-Tty.git -revision: 1b82bb0c888e9f8e3117c12429cfb6a39b4742eec348ac50f0778e3b081ea6aa +mtime: 1777014929 +commit: f9f3cd3ee97391b1c53746a2de65e375062591e6eff6b62e6309869441345cc5 +url: https://src.opensuse.org/perl/perl-IO-Tty +revision: f9f3cd3ee97391b1c53746a2de65e375062591e6eff6b62e6309869441345cc5 projectscmsync: https://src.opensuse.org/perl/_ObsPrj ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-04-24 09:15:29.000000000 +0200 @@ -0,0 +1 @@ +.osc
