From: espie Date: Sat, 1 Jul 2017 12:23:22 +0000 (+0000) Subject: go thru POSIX::Termios to turn off kerninfo. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=790e15f938aa09ff2e097f007380aa91ee7d2725;p=openbsd go thru POSIX::Termios to turn off kerninfo. wasn't even aware that stuff existed, thanks nicm@ NOKERNINFO hardcoded, because it's not in the POSIX module, shouldn't be a big issue. okay millert@ --- diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index f891bb478a7..1b10b2930c3 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.77 2017/03/25 18:58:59 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.78 2017/07/01 12:23:22 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie # @@ -103,9 +103,32 @@ sub parse_and_run my $state = $self->new_state($cmd); $state->handle_options; + + require POSIX; + + + my $termios = POSIX::Termios->new; + my $lflag; + + if (defined $termios->getattr) { + $lflag = $termios->getlflag; + } + + if (defined $lflag) { + my $NOKERNINFO = 0x02000000; # not defined in POSIX + $termios->setlflag($lflag | $NOKERNINFO); + $termios->setattr; + + } + local $SIG{'INFO'} = sub { $state->status->print($state); }; $self->framework($state); + + if (defined $lflag) { + $termios->setlflag($lflag); + $termios->setattr; + } return $state->{bad} != 0; }