don't print error in case rmdir fails because of ENOTEMPTY

Sun, 25 Aug 2019 10:57:33 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 25 Aug 2019 10:57:33 +0200
changeset 633
b7de5ecc30fa
parent 632
2e1b59290829
child 634
3ae1410b9d13

don't print error in case rmdir fails because of ENOTEMPTY

dav/sync.c file | annotate | diff | comparison | revisions
--- a/dav/sync.c	Sun Aug 25 09:43:12 2019 +0200
+++ b/dav/sync.c	Sun Aug 25 10:57:33 2019 +0200
@@ -1588,7 +1588,13 @@
     
     printf("delete: %s\n", res->path);
     if(rmdir(local_path)) {
-        fprintf(stderr, "rmdir: %s : %s", local_path, strerror(errno));
+        // don't print error when dirs are not empty
+        // because that can regulary happen, because the pull conflict
+        // detection can prevent files from being deleted and in this case
+        // the parent dir is not empty
+        if(errno != ENOTEMPTY) {
+            fprintf(stderr, "rmdir: %s : %s\n", local_path, strerror(errno));
+        }
         ret = 1;
     }
     

mercurial