the trick to get signal names requires skipping over POSIX stuff we don't
authorespie <espie@openbsd.org>
Sat, 23 Dec 2017 12:35:47 +0000 (12:35 +0000)
committerespie <espie@openbsd.org>
Sat, 23 Dec 2017 12:35:47 +0000 (12:35 +0000)
have now.

as seen by landry@

usr.sbin/pkg_add/OpenBSD/State.pm

index 114b300..7871441 100644 (file)
@@ -1,5 +1,5 @@
 # ex:ts=8 sw=4:
-# $OpenBSD: State.pm,v 1.47 2017/11/01 18:18:10 espie Exp $
+# $OpenBSD: State.pm,v 1.48 2017/12/23 12:35:47 espie Exp $
 #
 # Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
 #
@@ -383,7 +383,10 @@ sub fillup_names
 
        for my $sym (keys %POSIX::) {
                next unless $sym =~ /^SIG([A-Z].*)/;
-               $signal_name[eval "&POSIX::$sym()"] = $1;
+               my $value = eval "&POSIX::$sym()";
+               # skip over POSIX stuff we don't have like SIGRT or SIGPOLL
+               next unless defined $value;
+               $signal_name[$value] = $1;
        }
        # extra BSD signals
        $signal_name[5] = 'TRAP';