From: Eric Wong Date: Mon, 6 Apr 2020 20:23:01 +0000 (+0000) Subject: portability: constants for NetBSD X-Git-Tag: v1.4.0~15 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=17a3d433a1e8617a1e957da8efe11875efaa0f62 portability: constants for NetBSD NetBSD implements O_CLOEXEC, so let us use it to avoid inadvertant FD sharing. It also has the same value for SIGWINCH as Linux and the other BSDs we support. --- diff --git a/lib/PublicInbox/MultiMidQueue.pm b/lib/PublicInbox/MultiMidQueue.pm index 3c28ebbc..eb2ecf2f 100644 --- a/lib/PublicInbox/MultiMidQueue.pm +++ b/lib/PublicInbox/MultiMidQueue.pm @@ -8,7 +8,12 @@ use strict; use SDBM_File; # part of Perl standard library use Fcntl qw(O_RDWR O_CREAT); use File::Temp 0.19 (); # 0.19 for ->newdir -my %e = (freebsd => 0x100000, linux => 0x80000, openbsd => 0x10000); +my %e = ( + freebsd => 0x100000, + linux => 0x80000, + netbsd => 0x400000, + openbsd => 0x10000, +); my $O_CLOEXEC = $e{$^O} // 0; sub new { diff --git a/lib/PublicInbox/Sigfd.pm b/lib/PublicInbox/Sigfd.pm index 2d27f6a1..f500902e 100644 --- a/lib/PublicInbox/Sigfd.pm +++ b/lib/PublicInbox/Sigfd.pm @@ -15,6 +15,7 @@ sub new { my $self = fields::new($class); my %signo = map {; my $cb = $sig->{$_}; + # SIGWINCH is 28 on FreeBSD, NetBSD, OpenBSD my $num = ($_ eq 'WINCH' && $^O =~ /linux|bsd/i) ? 28 : do { my $m = "SIG$_"; POSIX->$m;