Module: sems
Branch: master
Commit: 46242169a39eaa7cfb6a42c0661c913981840a0a
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=46242169a39eaa7cfb6a42c0661c913981840a0a

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Sep 16 16:00:10 2010 +0200

voicemail: WARN if tmp file could not be unlinked

thanks to andrey for reporting

---

 apps/voicemail/AnswerMachine.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/apps/voicemail/AnswerMachine.cpp b/apps/voicemail/AnswerMachine.cpp
index c53d114..4d9c8ef 100644
--- a/apps/voicemail/AnswerMachine.cpp
+++ b/apps/voicemail/AnswerMachine.cpp
@@ -57,6 +57,7 @@
 #include <dirent.h>
 
 #include <time.h>
+#include <string.h>
 
 #define MOD_NAME               "voicemail"
 #define DEFAULT_AUDIO_EXT      "wav"
@@ -931,7 +932,10 @@ void AnswerMachineDialog::saveMessage()
   email_dict["vmsg_length"] = rec_len_s;
 
   if(!rec_size){
-    unlink(msg_filename.c_str());
+    if (unlink(msg_filename.c_str()) < 0) {
+      WARN("unlink(%s) failed: %s\n", 
+          msg_filename.c_str(), strerror(errno));
+    }
 
     // record in box empty messages as well
     if (AnswerMachineFactory::SaveEmptyMsg &&

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to