projects
/
chise
/
xemacs-chise.git.1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
XEmacs 21.4.9 "Informed Management".
[chise/xemacs-chise.git.1]
/
src
/
sysdep.c
diff --git
a/src/sysdep.c
b/src/sysdep.c
index
b81efbb
..
c307469
100644
(file)
--- a/
src/sysdep.c
+++ b/
src/sysdep.c
@@
-3158,9
+3158,11
@@
sys_rename (const char *old, const char *new)
/* Windows rename fails if NEW exists */
if (rename (old, new) == 0)
return 0;
/* Windows rename fails if NEW exists */
if (rename (old, new) == 0)
return 0;
- if (errno != EEXIST)
+ /* In some cases errno is EACCES if NEW exists */
+ if (errno != EEXIST && errno != EACCES)
+ return -1;
+ if (unlink (new) != 0)
return -1;
return -1;
- unlink (new);
#endif /* WIN32_NATIVE */
return rename (old, new);
}
#endif /* WIN32_NATIVE */
return rename (old, new);
}