summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-12-18 10:37:54 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-12-18 10:37:54 +0000
commit66067ff912a94e168671a2fbd3ce2b286fa4777a (patch)
treee21e8782d58012b8484a2cf4b9d442821eeb8cc4 /usr.sbin/pkg_add
parentc0c7e34a22ea5bc280d8d5cfde4305441fdeeb91 (diff)
use copy_file from state
always remove our special sighandlers on fork, this should prevent all the "smart" progress stuff to fail when perl children are active.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
index 770583e75b6..8b32c849e3e 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageRepository.pm,v 1.91 2010/11/22 10:26:04 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.92 2010/12/18 10:37:53 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -286,6 +286,11 @@ sub did_it_fork
if (!defined $pid) {
$self->{state}->fatal("Cannot fork: #1", $!);
}
+ if ($pid == 0) {
+ undef $SIG{'WINCH'};
+ undef $SIG{'CONT'};
+ undef $SIG{'INFO'};
+ }
}
sub exec_gunzip
@@ -351,7 +356,7 @@ sub may_copy
return;
}
}
- Copy($src, $destdir);
+ $self->{state}->copy_file($src, $destdir);
}
sub open_pipe
@@ -543,8 +548,6 @@ sub open_pipe
if ($pid2) {
$object->{pid2} = $pid2;
} else {
- undef $SIG{'WINCH'};
- undef $SIG{'CONT'};
open STDERR, '>', $object->{errors};
open(STDOUT, '>&', $wrfh) or
$self->{state}->fatal("Bad dup: #1", $!);