703 int sync_error = 0; |
703 int sync_error = 0; |
704 int sync_conflict = 0; |
704 int sync_conflict = 0; |
705 |
705 |
706 CxList *res_modified = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
706 CxList *res_modified = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
707 CxList *res_new = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
707 CxList *res_new = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
708 CxList *res_moved = cxLinkedListCreateSimple(CX_STORE_POINTERS); // type: MovedFile |
708 CxList *res_moved = cxLinkedListCreateSimple(CX_STORE_POINTERS); // type: MovedFile* |
709 CxList *res_link = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
709 CxList *res_link = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
710 CxList *res_conflict = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
710 CxList *res_conflict = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
711 CxList *res_mkdir = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
711 CxList *res_mkdir = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
712 CxList *res_metadata = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
712 CxList *res_metadata = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
713 CxList *res_broken = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
713 CxList *res_broken = cxLinkedListCreateSimple(CX_STORE_POINTERS); |
1731 } |
1731 } |
1732 local->skipped = 0; |
1732 local->skipped = 0; |
1733 local->size = 0; |
1733 local->size = 0; |
1734 |
1734 |
1735 // set metadata |
1735 // set metadata |
|
1736 sync_set_metadata_from_stat(local, &s); |
1736 if(sync_store_metadata(dir, local_path, local, res)) { |
1737 if(sync_store_metadata(dir, local_path, local, res)) { |
1737 fprintf(stderr, "Cannot store metadata: %s\n", res->path); |
1738 fprintf(stderr, "Cannot store metadata: %s\n", res->path); |
1738 } |
1739 } |
1739 sync_set_metadata_from_stat(local, &s); |
|
1740 |
1740 |
1741 // cleanup |
1741 // cleanup |
1742 free(local_path); |
1742 free(local_path); |
1743 return 0; |
1743 return 0; |
1744 } |
1744 } |
3478 t.actime = f.last_modified; |
3478 t.actime = f.last_modified; |
3479 t.modtime = f.last_modified; |
3479 t.modtime = f.last_modified; |
3480 if(utime(path, &t)) { |
3480 if(utime(path, &t)) { |
3481 fprintf(stderr, "utime failed for file: %s : %s\n", path, strerror(errno)); |
3481 fprintf(stderr, "utime failed for file: %s : %s\n", path, strerror(errno)); |
3482 ret = 1; |
3482 ret = 1; |
|
3483 } else { |
|
3484 local->last_modified = f.last_modified; |
3483 } |
3485 } |
3484 } |
3486 } |
3485 if((dir->metadata & FINFO_MODE) == FINFO_MODE && f.mode_set) { |
3487 if((dir->metadata & FINFO_MODE) == FINFO_MODE && f.mode_set) { |
3486 // set mode |
3488 // set mode |
3487 if(chmod(path, f.mode)) { |
3489 if(chmod(path, f.mode)) { |
3488 fprintf(stderr, "chmod failed for file: %s : %s\n", path, strerror(errno)); |
3490 fprintf(stderr, "chmod failed for file: %s : %s\n", path, strerror(errno)); |
3489 ret = 1; |
3491 ret = 1; |
|
3492 } else { |
|
3493 local->mode = f.mode; |
3490 } |
3494 } |
3491 } |
3495 } |
3492 } |
3496 } |
3493 |
3497 |
3494 if((dir->metadata & FINFO_XATTR) == FINFO_XATTR) { |
3498 if((dir->metadata & FINFO_XATTR) == FINFO_XATTR) { |