summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2006-09-27 21:41:25 +0000
committerJoshua Colp <jcolp@digium.com>2006-09-27 21:41:25 +0000
commit7a336e9f9daeeb0133a584491ffbf4d35bb3f0dd (patch)
tree07be56ad6a79786868b3916b0b9e3634d9297fb3 /apps/app_voicemail.c
parent7b0ba1bc7ec59e00ccdfd3d5c3ad40fe42dd4bb5 (diff)
Finish up last commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index f3342f709..6e50108e6 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4519,8 +4519,15 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
detected.
*/
+ if (vm_lock_path(vms->curdir)) {
+ ast_log(LOG_ERROR, "Could not open mailbox %s: mailbox is locked\n", vms->curdir);
+ return -1;
+ }
+
last_msg = last_message_index(vmu, vms->curdir);
- if (last_msg < 0)
+ ast_unlock_path(vms->curdir);
+
+ if (last_msg < 0)
return last_msg;
else if (vms->lastmsg != last_msg)
{