]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
check return value of unlink MODAPP-142
authorBrian West <brian@freeswitch.org>
Fri, 12 Sep 2008 15:29:53 +0000 (15:29 +0000)
committerBrian West <brian@freeswitch.org>
Fri, 12 Sep 2008 15:29:53 +0000 (15:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9538 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_voicemail/mod_voicemail.c

index c4412e23ffa642a68bb3dfdb872ac5b6b56121c5..d9649f83823d4310fe40033e62e9979247e10020 100644 (file)
@@ -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;