From: David Levine Date: Thu, 27 Feb 2014 01:58:43 +0000 (-0600) Subject: Updated mhparam, man pages, and test-mhparam to reflect split X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/2e857ecade62ec99c49386cf4f670c18f4be232b Updated mhparam, man pages, and test-mhparam to reflect split of locking methods into datalocking and spoollocking. --- diff --git a/Makefile.am b/Makefile.am index 73fd9ced..ef351909 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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. diff --git a/man/mh-folders.man b/man/mh-folders.man index cc6b3462..52cde277 100644 --- a/man/mh-folders.man +++ b/man/mh-folders.man @@ -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 diff --git a/man/mhparam.man b/man/mhparam.man index 6f51ffd9..bf7c40a3 100644 --- a/man/mhparam.man +++ b/man/mhparam.man @@ -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 diff --git a/test/common.sh.in b/test/common.sh.in index 85ec2089..4cf06e28 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -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 diff --git a/test/mhparam/test-mhparam b/test/mhparam/test-mhparam index cea61a7d..89bcb5d2 100755 --- a/test/mhparam/test-mhparam +++ b/test/mhparam/test-mhparam @@ -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 diff --git a/uip/mhparam.c b/uip/mhparam.c index 8a276f72..325a1a34 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -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; }