fixes that metadata is updated after stat in sync_get_resource

Thu, 28 Mar 2019 20:23:45 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 28 Mar 2019 20:23:45 +0100
changeset 547
4a249c645ae4
parent 546
33e312dd851d
child 548
ab46acda1066

fixes that metadata is updated after stat in sync_get_resource

dav/sync.c file | annotate | diff | comparison | revisions
--- a/dav/sync.c	Thu Mar 28 20:05:10 2019 +0100
+++ b/dav/sync.c	Thu Mar 28 20:23:45 2019 +0100
@@ -1168,11 +1168,6 @@
             }
         }
 
-        if(sys_stat(local_path, &s)) {
-            fprintf(stderr,
-                    "Cannot stat file %s: %s\n", local_path, strerror(errno));
-        }
-
         if(!local) {
             // new local resource
             local = calloc(1, sizeof(LocalResource));
@@ -1193,6 +1188,11 @@
         
         update_parts(local, part_updates, blockcount);
         
+        if(sys_stat(local_path, &s)) {
+            fprintf(stderr,
+                    "Cannot stat file %s: %s\n", local_path, strerror(errno));
+        }
+        
         // set metadata from stat
         local->etag = strdup(etag);
         if(content_hash) {

mercurial