From a2d98d6c7cb0ec08a03686fc782d68bae14e0495 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Wed, 27 Sep 2006 20:20:35 +0000 Subject: [PATCH] Avoid inability to lock directory log message by creating the directory ahead of time. (Issue 7631) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@43815 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_voicemail.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 70c9a17294..a2773dd7a8 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3806,7 +3806,9 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box) */ snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox); - make_dir(vms->curdir, sizeof(vms->curdir), vmu->context, vms->username, vms->curbox); + /* Faster to make the directory than to check if it exists. */ + create_dirpath(vms->curdir, sizeof(vms->curdir), vmu->context, vms->username, vms->curbox); + count_msg = count_messages(vmu, vms->curdir); if (count_msg < 0) return count_msg; -- 2.47.2