diff options
author | Tony Cook <tony@develop-help.com> | 2020-10-27 15:36:46 +0000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2020-11-05 15:47:30 +1100 |
commit | ec5a5b629f2f5a9b63b27eb6d71233781d32ae61 (patch) | |
tree | 3eaa70c0cc4507746ec75151b7d30c065d09a8e2 /ext/POSIX | |
parent | a28aea8ee0ac53a4a2490a509b47cf4dfa6015ea (diff) | |
download | perl-ec5a5b629f2f5a9b63b27eb6d71233781d32ae61.tar.gz |
dragonfly BSD sets errno incorrectly for terminal control functions
Diffstat (limited to 'ext/POSIX')
-rw-r--r-- | ext/POSIX/t/termios.t | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/ext/POSIX/t/termios.t b/ext/POSIX/t/termios.t index 380bee678b..5b1e6a6b8d 100644 --- a/ext/POSIX/t/termios.t +++ b/ext/POSIX/t/termios.t @@ -71,12 +71,22 @@ if (defined $termios) { $! = 0; is($termios->setattr(fileno $not_a_tty), undef, 'setattr on a non tty should fail'); - cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); + { + # https://bugs.dragonflybsd.org/issues/3252 + local $TODO = "dragonfly returns bad errno" + if $^O eq 'dragonfly'; + cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); + } $! = 0; is($termios->setattr(fileno $not_a_tty, TCSANOW), undef, 'setattr on a non tty should fail'); - cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); + { + # https://bugs.dragonflybsd.org/issues/3252 + local $TODO = "dragonfly returns bad errno" + if $^O eq 'dragonfly'; + cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); + } } { @@ -160,20 +170,40 @@ if (defined $termios) { $! = 0; is(tcdrain(fileno $not_a_tty), undef, 'tcdrain on a non tty should fail'); -cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); +{ + # https://bugs.dragonflybsd.org/issues/3252 + local $TODO = "dragonfly returns bad errno" + if $^O eq 'dragonfly'; + cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); +} $! = 0; is(tcflow(fileno $not_a_tty, TCOON), undef, 'tcflow on a non tty should fail'); -cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); +{ + # https://bugs.dragonflybsd.org/issues/3252 + local $TODO = "dragonfly returns bad errno" + if $^O eq 'dragonfly'; + cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); +} $! = 0; is(tcflush(fileno $not_a_tty, TCOFLUSH), undef, 'tcflush on a non tty should fail'); -cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); +{ + # https://bugs.dragonflybsd.org/issues/3252 + local $TODO = "dragonfly returns bad errno" + if $^O eq 'dragonfly'; + cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); +} $! = 0; is(tcsendbreak(fileno $not_a_tty, 0), undef, - 'tcsendbreak on a non tty should fail'); -cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); + 'tcsendbreak on a non tty should fail'); +{ + # https://bugs.dragonflybsd.org/issues/3252 + local $TODO = "dragonfly returns bad errno" + if $^O eq 'dragonfly'; + cmp_ok($!, '==', POSIX::ENOTTY, 'and set errno to ENOTTY'); +} done_testing(); |