about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-06-11 01:34:53 +0530
committerAndinus <andinus@nand.sh>2020-06-11 01:34:53 +0530
commit04a0c6a7a95321fea801364a2d6463bef5c42de6 (patch)
tree06d4ec92e0bd107ccbf785e376f2329d603987cb
parent434a3999daf0cc604fae9c7203145785c2578ff3 (diff)
downloadara-04a0c6a7a95321fea801364a2d6463bef5c42de6.tar.gz
Use OpenBSD::Unveil only on OpenBSD
This will fail if user doesn't has the path in @INC which might be
possible on custom Perl install. I'll add a note about this in README.

This is good for non-OpenBSD users as now the program will run on
their system without any changes.
-rwxr-xr-xara.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/ara.pl b/ara.pl
index d55fdfc..4df7f72 100755
--- a/ara.pl
+++ b/ara.pl
@@ -9,7 +9,13 @@ use Text::ASCIITable;
 use Getopt::Long qw( GetOptions );
 use JSON::MaybeXS qw( decode_json );
 
-use OpenBSD::Unveil;
+use constant is_OpenBSD => $^O eq "openbsd";
+if (is_OpenBSD) {
+    require OpenBSD::Unveil;
+    OpenBSD::Unveil->import;
+} else {
+    sub unveil { return 1; }
+}
 
 # Unveil @INC.
 foreach my $path (@INC) {