aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-28 16:28:26 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-28 16:28:26 +0000
commit5525846c14b619c422b4b1373a2b600438de9c96 (patch)
tree7c4fc12b586885d85fc9342e07f133056bb5f621 /main/asterisk.c
parent37e6efff7b51c5ac5e75a6c29db2470cf67d0911 (diff)
(closes issue #7852)
Reported by: nic_bellamy Patches: 2006-10-03_svn_44249_voicemail_lockmode_v3.patch uploaded by nic_bellamy (license 213) Add support for configurable file locking methods. The default is "lockfile", which is the old behavior. There is an additional option, "flock", which is intended for use in situations where the lockfile method will not work, such as with SMB/CIFS mounts. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81233 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 052bf629d..86d300e35 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2453,6 +2453,16 @@ static void ast_readconfig(void)
}
} else if (!strcasecmp(v->name, "languageprefix")) {
ast_language_is_prefix = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "lockmode")) {
+ if (!strcasecmp(v->value, "lockfile")) {
+ ast_set_lock_type(AST_LOCK_TYPE_LOCKFILE);
+ } else if (!strcasecmp(v->value, "flock")) {
+ ast_set_lock_type(AST_LOCK_TYPE_FLOCK);
+ } else {
+ ast_log(LOG_WARNING, "'%s' is not a valid setting for the lockmode option, "
+ "defaulting to 'lockfile'\n", v->value);
+ ast_set_lock_type(AST_LOCK_TYPE_LOCKFILE);
+ }
#if defined(HAVE_SYSINFO)
} else if (!strcasecmp(v->name, "minmemfree")) {
/* specify the minimum amount of free memory to retain. Asterisk should stop accepting new calls