]> granicus.if.org Git - mutt/commitdiff
Coda compatibility. From Jan Harkes <jaharkes@cs.cmu.edu>.
authorThomas Roessler <roessler@does-not-exist.org>
Sat, 22 Apr 2000 09:04:25 +0000 (09:04 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sat, 22 Apr 2000 09:04:25 +0000 (09:04 +0000)
lib.c

diff --git a/lib.c b/lib.c
index 0402b35a68b5439778111f034224c6aa0bdb2765..7dab43db64629c216135f67a2d7b7f42d2bcdd16 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -286,6 +286,22 @@ int safe_rename (const char *src, const char *target)
 
   if (link (src, target) != 0)
   {
+
+    /*
+     * Coda does not allow cross-directory links, but tells
+     * us it's a cross-filesystem linking attempt.
+     * 
+     * However, the Coda rename call is allegedly safe to use.
+     * 
+     * With other file systems, rename should just fail when 
+     * the files reside on different file systems, so it's safe
+     * to try it here.
+     *
+     */
+
+    if (errno == EXDEV)
+      return rename (src, target);
+    
     return -1;
   }