aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-13 05:07:32 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-13 05:07:32 +0000
commit66d609ac4887b81c5269e8b6e239e3875ba0ed40 (patch)
treed5e91583b7bb4c23a10d3a98fe2d0fb195a3b75c
parent8286bc81250ccb9f558a52b9589a79d0f2eee306 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@27127 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 8486ec10c..017c75c38 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -898,7 +898,7 @@ static int retrieve_file(char *dir, int msgnum)
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
goto yuck;
}
- fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC);
+ fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC, 0770);
if (fd < 0) {
ast_log(LOG_WARNING, "Failed to write '%s': %s\n", full_fn, strerror(errno));
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
@@ -925,13 +925,13 @@ static int retrieve_file(char *dir, int msgnum)
if (!strcasecmp(coltitle, "recording")) {
res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
fdlen = colsize;
- fd = open(full_fn, O_RDWR | O_TRUNC | O_CREAT, 0770);
if (fd > -1) {
char tmp[1]="";
lseek(fd, fdlen - 1, SEEK_SET);
if (write(fd, tmp, 1) != 1) {
close(fd);
fd = -1;
+ continue;
}
if (fd > -1)
fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);