mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 03:49:20 +03:00
Use new c_rename function.
This commit is contained in:
parent
3a51c9ce8b
commit
5f0f49b5bd
1 changed files with 1 additions and 22 deletions
|
@ -435,28 +435,7 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
|
|||
}
|
||||
|
||||
int csync_vio_local_rename(const char *olduri, const char *newuri) {
|
||||
_TCHAR *nuri = c_multibyte(newuri);
|
||||
_TCHAR *ouri = c_multibyte(olduri);
|
||||
int re = -1;
|
||||
|
||||
#ifdef _WIN32
|
||||
if(ouri && nuri) {
|
||||
if (MoveFileExW(ouri, nuri, MOVEFILE_COPY_ALLOWED + MOVEFILE_REPLACE_EXISTING + MOVEFILE_WRITE_THROUGH ) != 0) {
|
||||
/* Success */
|
||||
re = 0;
|
||||
} else {
|
||||
errno = GetLastError();
|
||||
}
|
||||
/* CSYNC_LOG( CSYNC_LOG_PRIORITY_DEBUG, "ERR: Could not rename, error %d", errno ); */
|
||||
} else {
|
||||
errno = ENOENT;
|
||||
}
|
||||
#else
|
||||
re = rename(ouri, nuri);
|
||||
#endif
|
||||
c_free_multibyte(nuri);
|
||||
c_free_multibyte(ouri);
|
||||
return re;
|
||||
return c_rename(olduri, newuri);
|
||||
}
|
||||
|
||||
int csync_vio_local_unlink(const char *uri) {
|
||||
|
|
Loading…
Reference in a new issue