]> diplodocus.org Git - minc/commitdiff
only supporting fcntl lock, so bail out if mh doesn't use that
authorEric Gillespie <epg@google.com>
Sat, 6 Dec 2014 00:23:02 +0000 (16:23 -0800)
committerEric Gillespie <epg@google.com>
Sat, 6 Dec 2014 00:23:02 +0000 (16:23 -0800)
minc

diff --git a/minc b/minc
index be32d8fbdfe02d82f486334302d739c7c5e0fbb2..2f3820e1d037981807af4772505a7742d0a063b2 100755 (executable)
--- a/minc
+++ b/minc
@@ -194,6 +194,15 @@ if (!$mh) {
 
 $ENV{"MHCONTEXT"} = $mh . '/.minc.context';
 
 
 $ENV{"MHCONTEXT"} = $mh . '/.minc.context';
 
+# TODO: Support dot-locking too.  This works on FreeBSD and Linux.
+my $locking = `mhparam datalocking`;
+$? < 0 && die;
+$? == 0 || die('mhparam datalocking: ' . exit_msg($?));
+chomp($locking);
+if ($locking ne 'fcntl') {
+    die("mh locking $locking not supported; only fcntl");
+}
+
 \f
 ###############################################################################
 # Utility procedures
 \f
 ###############################################################################
 # Utility procedures