+ my $locking = '';
+ open(my $fh, '-|', 'mhparam',
+ 'datalocking', 'mh-sequences', 'unseen-sequence') or die("open(mhparam|): $!");
+ while (<$fh>) {
+ chomp;
+ if (s/^fcntl:\s*//) {
+ $locking = $_;
+ } elsif (s/^mh-sequences:\s*//) {
+ $SEQ_FILE = $_;
+ } elsif (s/unseen-sequence:\s*//) {
+ $UNSEEN = $_;
+ }
+ }
+ if (!close($fh)) {
+ $! == 0 or die("open(mhparam|): $!");
+ die('mhparam '. exit_msg($?));
+ }
+
+ # TODO: Support dot-locking too. This works on FreeBSD and Linux.
+ if ($locking ne 'fcntl') {
+ die("mh locking '$locking' not supported; only fcntl");
+ }
+