--- asterisk/apps/app_voicemail.c 2004-02-27 00:59:27.000000000 -0500 +++ asterisk/apps/app_voicemail.c 2004-02-27 01:06:09.000000000 -0500 @@ -1338,7 +1338,6 @@ FILE *txt; int res = 0; int msgnum; - int fd; char date[256]; char dir[256]; char fn[256]; @@ -1474,15 +1473,12 @@ res = play_and_record(chan, NULL, fn, vmmaxmessage, fmt); if (res > 0) res = 0; - fd = open(txtfile, O_APPEND | O_WRONLY); - if (fd > -1) { - txt = fdopen(fd, "a"); - if (txt) { - time(&end); - fprintf(txt, "duration=%ld\n", (long)(end-start)); - fclose(txt); - } - } + txt = fopen(txtfile, "a"); + if (txt) { + time(&end); + fprintf(txt, "duration=%ld\n", (long)(end-start)); + fclose(txt); + } stringp = fmt; strsep(&stringp, "|"); /* Send e-mail if applicable */