even if you write signal handlers to not do anything stupid when you're
authorespie <espie@openbsd.org>
Mon, 26 Jul 2010 10:59:32 +0000 (10:59 +0000)
committerespie <espie@openbsd.org>
Mon, 26 Jul 2010 10:59:32 +0000 (10:59 +0000)
not on a terminal, they STILL interrupt long system calls and cause sysread
to fail, so disable them when they're not needed.

problem found by mlarkin@

this is just a band-aid, I guess I really need to "reset" non-needed signals
globally whenever I fork... sigh.

usr.sbin/pkg_add/OpenBSD/PackageRepository.pm

index dda5a0f..db89b81 100644 (file)
@@ -1,5 +1,5 @@
 # ex:ts=8 sw=4:
-# $OpenBSD: PackageRepository.pm,v 1.86 2010/07/02 12:41:43 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.87 2010/07/26 10:59:32 espie Exp $
 #
 # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
 #
@@ -543,6 +543,8 @@ 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", $!);