aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-05 19:05:34 +0000
committerautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-05 19:05:34 +0000
commit98e03b27687c456a3e84072e74ac9648f69cac5e (patch)
treedc6538d9b93b5dd7ae464e9dae29d0e776c7e259 /apps
parent55bb915a34dc536c8129f4a10b56e9cbb1855d56 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@57913 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 98bb8b96e..23cf6bd4b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -785,7 +785,7 @@ static int make_file(char *dest, int len, char *dir, int num)
* @context String. Ignored if is null or empty string.
* @ext String. Ignored if is null or empty string.
* @mailbox String. Ignored if is null or empty string.
- * @returns 0 on failure, 1 on success.
+ * @returns -1 on failure, 0 on success.
* */
static int create_dirpath(char *dest, int len, char *context, char *ext, char *mailbox)
{
@@ -795,24 +795,24 @@ static int create_dirpath(char *dest, int len, char *context, char *ext, char *m
make_dir(dest, len, context, "", "");
if(mkdir(dest, mode) && errno != EEXIST) {
ast_log(LOG_WARNING, "mkdir '%s' failed: %s\n", dest, strerror(errno));
- return 0;
+ return -1;
}
}
if(ext && ext[0] != '\0') {
make_dir(dest, len, context, ext, "");
if(mkdir(dest, mode) && errno != EEXIST) {
ast_log(LOG_WARNING, "mkdir '%s' failed: %s\n", dest, strerror(errno));
- return 0;
+ return -1;
}
}
if(mailbox && mailbox[0] != '\0') {
make_dir(dest, len, context, ext, mailbox);
if(mkdir(dest, mode) && errno != EEXIST) {
ast_log(LOG_WARNING, "mkdir '%s' failed: %s\n", dest, strerror(errno));
- return 0;
+ return -1;
}
}
- return 1;
+ return 0;
}
/* only return failure if ast_lock_path returns 'timeout',
@@ -1970,7 +1970,7 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, context, ext);
- if (!(res = create_dirpath(dest, sizeof(dest), context, ext, "greet"))) {
+ if ((res = create_dirpath(dest, sizeof(dest), context, ext, "greet"))) {
ast_log(LOG_WARNING, "Failed to make directory(%s)\n", fn);
return -1;
}
@@ -2477,7 +2477,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, ext);
}
snprintf(tempfile, sizeof(tempfile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, ext);
- if (!(res = create_dirpath(dest, sizeof(dest), vmu->context, ext, "temp"))) {
+ if ((res = create_dirpath(dest, sizeof(dest), vmu->context, ext, "temp"))) {
ast_log(LOG_WARNING, "Failed to make directory (%s)\n", tempfile);
return -1;
}
@@ -4864,7 +4864,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
snprintf(prefile,sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
- if (!(res = create_dirpath(dest, sizeof(dest), vmu->context, vms->username, "temp"))) {
+ if ((res = create_dirpath(dest, sizeof(dest), vmu->context, vms->username, "temp"))) {
ast_log(LOG_WARNING, "Failed to create directory (%s).\n", prefile);
return -1;
}