aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-21 07:06:15 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-21 07:06:15 +0000
commitaaa1f8e40c02855f419cb394e0791b2e2936bd84 (patch)
treec2a3f98db5318c763666e02e66d82a4ff55c43a7
parent03e6202ae65d0728d6523588f680a616ba36c2bf (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@13784 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 43eb4fb66..4c0229e3e 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2367,7 +2367,7 @@ struct leave_vm_options {
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
{
- char txtfile[256];
+ char tmptxtfile[256], txtfile[256];
char callerid[256];
FILE *txt;
int res = 0;
@@ -2564,7 +2564,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* Store information */
snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
- txt = fopen(txtfile, "w+");
+ snprintf(tmptxtfile, sizeof(tmptxtfile), "%s.txt.tmp", fn);
+ txt = fopen(tmptxtfile, "w+");
if (txt) {
get_date(date, sizeof(date));
fprintf(txt,
@@ -2604,6 +2605,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
if (txt) {
fprintf(txt, "duration=%d\n", duration);
fclose(txt);
+ rename(tmptxtfile, txtfile);
}
if (duration < vmminmessage) {