aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-05 17:52:03 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-05 17:52:03 +0000
commitc47e0ff5a2549ea5733042e71687dd34a71e6c6d (patch)
tree8a686f51b98a6c1842141ace091b6bf4fe848444 /apps
parent304723a95b0701d6ee89eabb8008d5cafba324ea (diff)
Merged revisions 57869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57869 | file | 2007-03-05 12:49:18 -0500 (Mon, 05 Mar 2007) | 2 lines Make create_dirpath use our standard for return values. -1 is failure, 0 is success. (issue #9205 reported by ballares) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57870 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 edf5d454b..91a31e2de 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -898,7 +898,7 @@ static int make_file(char *dest, int len, char *dir, int num)
* \param context String. Ignored if is null or empty string.
* \param ext String. Ignored if is null or empty string.
* \param folder String. Ignored if is null or empty string.
- * \return 0 on failure, 1 on success.
+ * \return -1 on failure, 0 on success.
*/
static int create_dirpath(char *dest, int len, const char *context, const char *ext, const char *folder)
{
@@ -908,24 +908,24 @@ static int create_dirpath(char *dest, int len, const char *context, const char *
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 (!ast_strlen_zero(ext)) {
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 (!ast_strlen_zero(folder)) {
make_dir(dest, len, context, ext, folder);
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',
@@ -2132,7 +2132,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;
}
@@ -2870,7 +2870,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;
}
@@ -5923,7 +5923,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
}
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;
}