summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2019-04-07 12:30:40 +0000
committerMarc Espie <espie@cvs.openbsd.org>2019-04-07 12:30:40 +0000
commita138556c90762652c79d429844355f71f59c5b09 (patch)
treed5c67067620be20b149503ffdad67324bea44dd2 /usr.sbin/pkg_add
parenta3fbfcf9541945ceb7af025fe7b00d7b2de2afe0 (diff)
don't silence children under fw_update, since ftp(1) can tell us
what's wrong with the network. okay deraadt@
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/AddDelete.pm35
-rw-r--r--usr.sbin/pkg_add/OpenBSD/FwUpdate.pm7
2 files changed, 27 insertions, 15 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
index ecd95aee559..8c74c503f59 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.83 2018/07/11 16:53:14 espie Exp $
+# $OpenBSD: AddDelete.pm,v 1.84 2019/04/07 12:30:39 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
@@ -119,34 +119,41 @@ sub parse_and_run
my $state = $self->new_state($cmd);
$state->handle_options;
- require POSIX;
+ local $SIG{'INFO'} = sub { $state->status->print($state); };
+ my ($lflag, $termios);
+ if ($self->silence_children($state)) {
+ require POSIX;
- my $termios = POSIX::Termios->new;
- my $lflag;
+ $termios = POSIX::Termios->new;
- if (defined $termios->getattr) {
- $lflag = $termios->getlflag;
- }
+ if (defined $termios->getattr) {
+ $lflag = $termios->getlflag;
+ }
- if (defined $lflag) {
- my $NOKERNINFO = 0x02000000; # not defined in POSIX
- $termios->setlflag($lflag | $NOKERNINFO);
- $termios->setattr;
-
+ 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;
}
+sub silence_children
+{
+ 1
+}
+
# nothing to do
sub tweak_list
{
diff --git a/usr.sbin/pkg_add/OpenBSD/FwUpdate.pm b/usr.sbin/pkg_add/OpenBSD/FwUpdate.pm
index 9dc7f3b5307..7436c2d51a0 100644
--- a/usr.sbin/pkg_add/OpenBSD/FwUpdate.pm
+++ b/usr.sbin/pkg_add/OpenBSD/FwUpdate.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: FwUpdate.pm,v 1.29 2019/03/11 05:05:14 jsg Exp $
+# $OpenBSD: FwUpdate.pm,v 1.30 2019/04/07 12:30:39 espie Exp $
#
# Copyright (c) 2014 Marc Espie <espie@openbsd.org>
#
@@ -282,6 +282,11 @@ sub show_info
$state->fw_status("Missing", \@needed);
}
+sub silence_children
+{
+ 0
+}
+
sub process_parameters
{
my ($self, $state) = @_;