summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-05-10 18:35:14 +0000
committerJonathan Rose <jrose@digium.com>2012-05-10 18:35:14 +0000
commit8227f70cd70f497cb03c1f9aab63950bcd979d8b (patch)
tree4f4587c0997f7a2d7ad8c6ecc89c3ad2971d5027 /apps
parent3430da58e9f168e608e46133225e0fc81589f6ef (diff)
Coverity Report: Fix issues for error type CHECKED_RETURN for core
(issue ASTERISK-19658) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1905/ ........ Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c12
-rw-r--r--apps/app_voicemail.c15
2 files changed, 21 insertions, 6 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index e6b997021..7db08193c 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4946,7 +4946,9 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char *
res2 |= ast_safe_sleep(peer, qe->parent->memberdelay * 1000);
}
if (!res2 && announce) {
- play_file(peer, announce);
+ if (play_file(peer, announce) < 0) {
+ ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", announce, ast_channel_name(peer));
+ }
}
if (!res2 && qe->parent->reportholdtime) {
if (!play_file(peer, qe->parent->sound_reporthold)) {
@@ -4957,11 +4959,15 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char *
holdtimesecs = abs((now - qe->start) % 60);
if (holdtime > 0) {
ast_say_number(peer, holdtime, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
- play_file(peer, qe->parent->sound_minutes);
+ if (play_file(peer, qe->parent->sound_minutes) < 0) {
+ ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_minutes, ast_channel_name(peer));
+ }
}
if (holdtimesecs > 1) {
ast_say_number(peer, holdtimesecs, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
- play_file(peer, qe->parent->sound_seconds);
+ if (play_file(peer, qe->parent->sound_seconds) < 0) {
+ ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_seconds, ast_channel_name(peer));
+ }
}
}
}
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 55aec5d22..d4da42b03 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6983,7 +6983,10 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
strncat(vms->introfn, "intro", sizeof(vms->introfn));
ast_play_and_wait(chan, INTRO);
ast_play_and_wait(chan, "beep");
- play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vm_fmts, 1, vmu, (int *) duration, NULL, NULL, record_gain, vms, flag);
+ cmd = play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vm_fmts, 1, vmu, (int *) duration, NULL, NULL, record_gain, vms, flag);
+ if (cmd == -1) {
+ break;
+ }
cmd = 't';
#else
@@ -9561,7 +9564,10 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
retries = 0;
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL) <= 0) {
- play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
+ cmd = play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
+ if (cmd == -1) {
+ break;
+ }
cmd = 't';
} else {
switch (cmd) {
@@ -11762,6 +11768,7 @@ static void mwi_sub_event_cb(const struct ast_event *event, void *userdata)
static void start_poll_thread(void)
{
+ int errcode;
mwi_sub_sub = ast_event_subscribe(AST_EVENT_SUB, mwi_sub_event_cb, "Voicemail MWI subscription", NULL,
AST_EVENT_IE_EVENTTYPE, AST_EVENT_IE_PLTYPE_UINT, AST_EVENT_MWI,
AST_EVENT_IE_END);
@@ -11775,7 +11782,9 @@ static void start_poll_thread(void)
poll_thread_run = 1;
- ast_pthread_create(&poll_thread, NULL, mb_poll_thread, NULL);
+ if ((errcode = ast_pthread_create(&poll_thread, NULL, mb_poll_thread, NULL))) {
+ ast_log(LOG_ERROR, "Could not create thread: %s\n", strerror(errcode));
+ }
}
static void stop_poll_thread(void)