From: Thomas Roessler Date: Sat, 22 Apr 2000 09:04:25 +0000 (+0000) Subject: Coda compatibility. From Jan Harkes . X-Git-Tag: mutt-1-1-12-rel~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=574983e725f622712d8a67be67ecd3dd784cf214;p=mutt Coda compatibility. From Jan Harkes . --- diff --git a/lib.c b/lib.c index 0402b35a..7dab43db 100644 --- 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; }