diff -r a182e503617b -r dc74f736aea1 dav/sync.c --- a/dav/sync.c Sun Jun 10 12:35:00 2018 +0200 +++ b/dav/sync.c Sun Jun 10 13:22:04 2018 +0200 @@ -345,7 +345,6 @@ fprintf(stderr, "Too %s arguments\n", a->argc < 1 ? "few" : "many"); return -1; } - // if there are syntax errors in the command line, fail asap. SyncTagFilter* tagfilter = parse_tagfilter_string(cmd_getoption(a, "tags")); if (!tagfilter) { @@ -661,8 +660,7 @@ int ret = 0; char *tmp_path = create_tmp_download_path(local_path); if(res->iscollection) { - mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; - if(util_mkdir(local_path, mode) && errno != EEXIST) { + if(sys_mkdir(local_path) && errno != EEXIST) { ret = -1; } @@ -741,7 +739,7 @@ local->size = s.st_size; local->skipped = FALSE; } else { - if(unlink(tmp_path)) { + if(sys_unlink(tmp_path)) { fprintf(stderr, "Cannot remove tmp file: %s\n", tmp_path); } } @@ -774,7 +772,7 @@ int ret = 0; if(dir->trash) { move_to_trash(dir, local_path); - } else if(unlink(local_path)) { + } else if(sys_unlink(local_path)) { fprintf(stderr, "Cannot remove file %s\n", local_path); ret = -2; } @@ -1999,7 +1997,7 @@ UCX_MAP_FOREACH(key, res, i) { printf("delete: %s\n", res->path); char *path = util_concat_path(dir->path, res->path); - if(unlink(path)) { + if(sys_unlink(path)) { if(errno != ENOENT) { perror("unlink"); num_err++; @@ -2204,7 +2202,7 @@ perror("rmdir"); } } else { - if(unlink(path)) { + if(sys_unlink(path)) { perror("unlink"); } }