33use strict;
44use Config;
55use Test::More;
6+ use Cwd " getcwd" ;
67
78BEGIN {
89 plan skip_all => " POSIX is unavailable"
@@ -47,6 +48,10 @@ foreach (undef, qw(STDIN STDOUT STDERR)) {
4748 }
4849}
4950
51+ my $cwd = getcwd;
52+ my $is_afs_path = $Config {afs } eq " true" &&
53+ $cwd && $cwd =~ / ^\Q $Config {afsroot}/ ;
54+
5055open my $not_a_tty , ' <' , $^X or die " Can't open $^X: $! " ;
5156
5257if (defined $termios ) {
@@ -75,6 +80,8 @@ if (defined $termios) {
7580 # https://bugs.dragonflybsd.org/issues/3252
7681 local $TODO = " dragonfly returns bad errno"
7782 if $^O eq ' dragonfly' ;
83+ local $TODO = " AFS doesn't report ENOTTY as it should"
84+ if $is_afs_path ;
7885 cmp_ok($! , ' ==' , POSIX::ENOTTY, ' and set errno to ENOTTY' );
7986 }
8087
@@ -85,6 +92,8 @@ if (defined $termios) {
8592 # https://bugs.dragonflybsd.org/issues/3252
8693 local $TODO = " dragonfly returns bad errno"
8794 if $^O eq ' dragonfly' ;
95+ local $TODO = " AFS doesn't report ENOTTY as it should"
96+ if $is_afs_path ;
8897 cmp_ok($! , ' ==' , POSIX::ENOTTY, ' and set errno to ENOTTY' );
8998 }
9099}
@@ -174,6 +183,8 @@ is(tcdrain(fileno $not_a_tty), undef, 'tcdrain on a non tty should fail');
174183 # https://bugs.dragonflybsd.org/issues/3252
175184 local $TODO = " dragonfly returns bad errno"
176185 if $^O eq ' dragonfly' ;
186+ local $TODO = " AFS doesn't report ENOTTY as it should"
187+ if $is_afs_path ;
177188 cmp_ok($! , ' ==' , POSIX::ENOTTY, ' and set errno to ENOTTY' );
178189}
179190
@@ -183,6 +194,8 @@ is(tcflow(fileno $not_a_tty, TCOON), undef, 'tcflow on a non tty should fail');
183194 # https://bugs.dragonflybsd.org/issues/3252
184195 local $TODO = " dragonfly returns bad errno"
185196 if $^O eq ' dragonfly' ;
197+ local $TODO = " AFS doesn't report ENOTTY as it should"
198+ if $is_afs_path ;
186199 cmp_ok($! , ' ==' , POSIX::ENOTTY, ' and set errno to ENOTTY' );
187200}
188201
@@ -193,6 +206,8 @@ is(tcflush(fileno $not_a_tty, TCOFLUSH), undef,
193206 # https://bugs.dragonflybsd.org/issues/3252
194207 local $TODO = " dragonfly returns bad errno"
195208 if $^O eq ' dragonfly' ;
209+ local $TODO = " AFS doesn't report ENOTTY as it should"
210+ if $is_afs_path ;
196211 cmp_ok($! , ' ==' , POSIX::ENOTTY, ' and set errno to ENOTTY' );
197212}
198213
@@ -203,6 +218,8 @@ is(tcsendbreak(fileno $not_a_tty, 0), undef,
203218 # https://bugs.dragonflybsd.org/issues/3252
204219 local $TODO = " dragonfly returns bad errno"
205220 if $^O eq ' dragonfly' ;
221+ local $TODO = " AFS doesn't report ENOTTY as it should"
222+ if $is_afs_path ;
206223 cmp_ok($! , ' ==' , POSIX::ENOTTY, ' and set errno to ENOTTY' );
207224}
208225
0 commit comments