From d62f106bbe9b01130e760b5582bd04b9edd69413 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 12 Sep 2008 15:29:53 +0000 Subject: [PATCH] check return value of unlink MODAPP-142 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9538 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_voicemail/mod_voicemail.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index c4412e23ff..d9649f8382 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1253,7 +1253,9 @@ static char *vm_merge_file(switch_core_session_t *session, vm_profile_t *profile } - unlink(announce); + if (unlink(announce) != 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "failed to delete file [%s]\n", announce); + } ret = tmp_path; end: @@ -1496,7 +1498,9 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t end: if (forward_file_path) { - unlink(forward_file_path); + if (unlink(forward_file_path) != 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "failed to delete file [%s]\n", forward_file_path); + } } return status;