]> diplodocus.org Git - nmh/commitdiff
Updated mhparam, man pages, and test-mhparam to reflect split
authorDavid Levine <levinedl@acm.org>
Thu, 27 Feb 2014 01:58:43 +0000 (19:58 -0600)
committerDavid Levine <levinedl@acm.org>
Thu, 27 Feb 2014 01:58:43 +0000 (19:58 -0600)
of locking methods into datalocking and spoollocking.

Makefile.am
man/mh-folders.man
man/mhparam.man
test/common.sh.in
test/mhparam/test-mhparam
uip/mhparam.c

index 73fd9ce..ef35190 100644 (file)
@@ -38,6 +38,7 @@ TESTS_ENVIRONMENT = MH_OBJ_DIR="@abs_builddir@" \
                    auxexecdir="$(auxexecdir)" bindir="$(bindir)" \
                    mandir="$(mandir)" sysconfdir="$(sysconfdir)" \
                    supported_locks="$(supported_locks)" \
+                   default_locking="${default_locking}" \
                    MULTIBYTE_ENABLED=$(MULTIBYTE_ENABLED) \
                    ICONV_ENABLED=$(ICONV_ENABLED) \
                    $(TESTS_SHELL) ## Keep at end of TESTS_ENVIRONMENT.
index cc6b346..52cde27 100644 (file)
@@ -1,4 +1,4 @@
-.TH MH-FOLDERS %manext5% "February 23, 2014" "%nmhversion%"
+.TH MH-FOLDERS %manext5% "February 26, 2014" "%nmhversion%"
 .\"
 .\" %nmhwarning%
 .\"
@@ -128,10 +128,24 @@ outside of
 that accesses these files must be sure to lock them using the same
 locking method as
 .BR nmh .
-The locking method is selected when
+The default data locking method is selected when
 .B nmh
 is configured and can be accessed as a string using
-.BR "mhparam lockmethod" .
+.BR "mhparam datalocking" .
+By default, fcntl locking is used, but this may be overridden with
+the
+.B datalocking
+profile entry.
+.PP
+A second, possibly different, locking method is used by
+.BR inc (1)
+when accessing the user's mail spool file or by
+.B nmh
+programs that open any mbox file.  This locking method is selected
+when
+.B nmh
+is configured and can be accessed as a string using
+.BR "mhparam spoollocking" .
 By default, kernel-level locking is used if appropriate for the
 platform, and it is for popular platforms.  That default should also
 be the same as used by the
index 6f51ffd..bf7c40a 100644 (file)
@@ -1,4 +1,4 @@
-.TH MHPARAM %manext1% "November 6, 2012" "%nmhversion%"
+.TH MHPARAM %manext1% "February 26, 2014" "%nmhversion%"
 .\"
 .\" %nmhwarning%
 .\"
@@ -52,7 +52,7 @@ and
 .I libdir
 install directories, all
 .I proc
-settings, and the locking method with which the
+settings, and the default locking method with which the
 .B nmh
 installation was configured.  The
 .B \-debug
@@ -91,8 +91,11 @@ context: context
 % mhparam libdir
 %libdir%
 
-% mhparam lockmethod
+% mhparam datalocking
 fcntl
+
+% mhparam spoollocking
+flock
 .fi
 .RE
 .PP
index 85ec208..4cf06e2 100644 (file)
@@ -14,6 +14,7 @@ test -z "$bindir"  &&  bindir="@bindir@"
 test -z "$mandir"  &&  mandir="@mandir@"
 test -z "$sysconfdir"  &&  sysconfdir="@sysconfdir@"
 test -z "$supported_locks"  &&  supported_locks="@supported_locks@"
+test -z "$default_locking"  &&  default_locking="@default_locking@"
 test -z "$MULTIBYTE_ENABLED"  &&  MULTIBYTE_ENABLED="@MULTIBYTE_ENABLED@"
 test -z "$ICONV_ENABLED"  &&  ICONV_ENABLED="@ICONV_ENABLED@"
 export MH_TEST_DIR auxexecdir bindir mandir sysconfdir
index cea61a7..89bcb5d 100755 (executable)
@@ -100,6 +100,8 @@ $bindir/whatnow
 $bindir/whom
 $sysconfdir
 ${MH_LIB_DIR}
+fcntl
+${default_locking}
 EOF
 
 run_prog mhparam -nocomponent \
@@ -125,7 +127,9 @@ vmhproc \
 whatnowproc \
 whomproc \
 etcdir \
-libdir >$actual 2>&1
+libdir \
+datalocking \
+spoollocking >$actual 2>&1
 
 check $expected $actual
 
index 8a276f7..325a1a3 100644 (file)
@@ -33,19 +33,9 @@ extern char *mhetcdir;
 
 char *sbackup = BACKUP_PREFIX;
 
-char *lockmethod =
-#if defined FCNTL_LOCKING
-    "fcntl"
-#elif defined FLOCK_LOCKING
-    "flock"
-#elif defined LOCKF_LOCKING
-    "lockf"
-#elif defined DOT_LOCKING
-    "dot"
-#else
-    "none"
-#endif
-    ;
+char *datalocking = "fcntl";
+
+extern char *spoollocking;
 
 char *sasl =
 #ifdef CYRUS_SASL
@@ -109,7 +99,8 @@ static struct proc procs [] = {
      { "etcdir",           &mhetcdir },
      { "libdir",           &mhlibdir },
      { "sbackup",          &sbackup },
-     { "lockmethod",       &lockmethod },
+     { "datalocking",      &datalocking },
+     { "spoollocking",     &spoollocking },
      { "sasl",             &sasl },
      { "tls",              &tls },
      { NULL,               NULL },
@@ -191,6 +182,9 @@ main(int argc, char **argv)
     } else if (debug) {
        struct proc *ps;
 
+       /* Need to see if datalocking was set in profile. */
+       if ((cp = context_find("datalocking"))) { datalocking = cp; }
+
        /*
         * Print the current value of everything in
         * procs array.  This will show their current
@@ -218,7 +212,7 @@ main(int argc, char **argv)
                missed++;
        }
     }
-    
+
     done (missed);
     return 1;
 }