diff -r f49964cf7228 -r bb1e60fada74 dav/system.c --- a/dav/system.c Sat Apr 20 17:47:40 2019 +0200 +++ b/dav/system.c Sat Apr 20 18:46:00 2019 +0200 @@ -32,6 +32,7 @@ #include #include #include +#include #ifndef _WIN32 #include @@ -111,6 +112,17 @@ return readlink(path, buffer, size); } +int sys_symlink(const char *target, const char *linkpath) { + int err = symlink(target, linkpath); + if(err && errno == EEXIST) { + if(unlink(linkpath)) { + return 1; + } + return sys_symlink(target, linkpath); + } + return err; +} + #else /* ---------- Windows implementation ---------- */ @@ -294,4 +306,10 @@ return 1; } +int sys_symlink(const char *target, const char *linkpath) { + // TODO + fprintf(stderr, "sys_symlink: implement me\n"); + return 1; +} + #endif