summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-08-14 19:31:12 +0300
committerEli Zaretskii <eliz@gnu.org>2017-08-14 19:31:12 +0300
commit5ba4c7d16b800864fa14b8a981e33f6aa6fa94d6 (patch)
tree8df544b12987a25dca4e8f01e98614a767c37b17 /src
parent16f11be4b96fc37204dc950e64f78ed340cd70d8 (diff)
downloademacs-5ba4c7d16b800864fa14b8a981e33f6aa6fa94d6.tar.gz
Implement renameat_noreplace for MS-Windows
* src/sysdep.c (renameat_noreplace) [WINDOWSNT]: Implement minimal emulation for MS-Windows. (Bug#27986)
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 9eb733221e4..35f499c1853 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2694,6 +2694,10 @@ renameat_noreplace (int srcfd, char const *src, int dstfd, char const *dst)
#if defined SYS_renameat2 && defined RENAME_NOREPLACE
return syscall (SYS_renameat2, srcfd, src, dstfd, dst, RENAME_NOREPLACE);
#else
+#ifdef WINDOWSNT
+ if (srcfd == AT_FDCWD && dstfd == AT_FDCWD)
+ return sys_rename_replace (src, dst, 0);
+#endif
errno = ENOSYS;
return -1;
#endif