From: Eli Zaretskii Date: Mon, 14 Aug 2017 16:31:12 +0000 (+0300) Subject: Implement renameat_noreplace for MS-Windows X-Git-Tag: emacs-26.0.90~463 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ba4c7d16b800864fa14b8a981e33f6aa6fa94d6;p=emacs.git Implement renameat_noreplace for MS-Windows * src/sysdep.c (renameat_noreplace) [WINDOWSNT]: Implement minimal emulation for MS-Windows. (Bug#27986) --- 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