mirror of
https://github.com/textmate/textmate.git
synced 2026-01-21 04:38:13 -05:00
Treat most errors from exchangedata() as “not supported”
It seems to be a general trend with network file systems to return wrong errors when they do not support a certain feature (like extended attributes and atomic swap).
This commit is contained in:
@@ -16,8 +16,12 @@ namespace path
|
||||
if(exchangedata(src.c_str(), dst.c_str(), 0) == 0)
|
||||
return unlink(src.c_str()) == 0;
|
||||
|
||||
if(errno == EFAULT) // Workaround for ExpanDrive
|
||||
if(errno != ENOTSUP && errno != ENOENT && errno != EXDEV)
|
||||
{
|
||||
// ExpanDrive returns EFAULT
|
||||
fprintf(stderr, "warning: exchangedata(“%s”, “%s”) failed with “%s”, treating as “%s”.\n", src.c_str(), dst.c_str(), strerror(errno), strerror(ENOTSUP));
|
||||
errno = ENOTSUP;
|
||||
}
|
||||
|
||||
D(DBF_IO_Swap_File_Data, bug("exchangedata() failed: %s\n", strerror(errno)););
|
||||
if(errno == ENOTSUP || errno == ENOENT)
|
||||
|
||||
Reference in New Issue
Block a user