Subject: | [PATCH] better flock checking in flock.t |
Hi Paul. I was doing a test core build on an older VMS system that does not have flock. The
flock.t test died with something like:
$ perl [-.lib.autodie.t]flock.t
The flock() function is unimplemented at [-.lib.autodie.t]flock.tline 26.
%SYSTEM-F-IVCHAN, invalid I/O channel
The attached patch puts the first flock call inside an eval so we bow out gracefully and get your
intended skip message:
$ perl [-.lib.autodie.t]flock.t
1..0 # SKIP flock on my own test not supported on this system.
You could also muck about without $Config{d_flock} and $Config{d_fcntl_can_lock}, but this
seems simpler.
Subject: | noflock.patch |
--- lib/autodie/t/flock.t;-0 Fri Jul 3 09:41:06 2009
+++ lib/autodie/t/flock.t Sat Jul 11 09:45:35 2009
@@ -23,7 +23,7 @@ if ($@) {
plan skip_all => "Cannot lock this test on this system.";
}
-my $flock_return = flock($self_fh, LOCK_EX | LOCK_NB);
+my $flock_return = eval { flock($self_fh, LOCK_EX | LOCK_NB); };
if (not $flock_return) {
plan skip_all => "flock on my own test not supported on this system.";