]> granicus.if.org Git - fcron/commitdiff
check for error code with function remove()
authorthib <thib>
Fri, 15 Dec 2000 17:51:49 +0000 (17:51 +0000)
committerthib <thib>
Fri, 15 Dec 2000 17:51:49 +0000 (17:51 +0000)
conf.c

diff --git a/conf.c b/conf.c
index ce86c1bbf37d28dce1f61dedf0e4888a751c5e33..702a874ad7f2e390e190b7409790ef01c24e4fc6 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -22,7 +22,7 @@
  *  `LICENSE' that comes with the fcron source distribution.
  */
 
- /* $Id: conf.c,v 1.31 2000-12-14 21:21:46 thib Exp $ */
+ /* $Id: conf.c,v 1.32 2000-12-15 17:51:49 thib Exp $ */
 
 #include "fcron.h"
 
@@ -138,8 +138,10 @@ synchronize_dir(const char *dir_name)
     for (list_cur = rm_list; list_cur; list_cur = list_cur->next ) {
        explain("removing file '%s'", list_cur->str + 3);
        delete_file(list_cur->str + 3);  /* len("rm.") = 3 */
-       remove(list_cur->str + 3);
-       remove(list_cur->str);
+       if ( remove(list_cur->str + 3) != 0 && errno != ENOENT )
+           error_e("Could not remove '%s'", list_cur->str + 3);
+       if ( remove(list_cur->str) != 0 && errno != ENOENT )
+           error_e("Could not remove '%s'", list_cur->str);
     }
     
     /* finally add new files */