mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-08 20:09:46 +08:00
ignore ENOTSUP errors when cloning paths. fixes #82
This commit is contained in:
parent
2ee3d4eec2
commit
4d605388a4
21
src/fs.cpp
21
src/fs.cpp
|
@ -420,6 +420,23 @@ namespace fs
|
||||||
return set_fs_ioc_flags(to,flags);
|
return set_fs_ioc_flags(to,flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool
|
||||||
|
ignorable_error(const int err)
|
||||||
|
{
|
||||||
|
switch(err)
|
||||||
|
{
|
||||||
|
case ENOTTY:
|
||||||
|
case ENOTSUP:
|
||||||
|
#if ENOTSUP != EOPNOTSUPP
|
||||||
|
case EOPNOTSUPP:
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
clonepath(const string &fromsrc,
|
clonepath(const string &fromsrc,
|
||||||
const string &tosrc,
|
const string &tosrc,
|
||||||
|
@ -464,11 +481,11 @@ namespace fs
|
||||||
|
|
||||||
// It may not support it... it's fine...
|
// It may not support it... it's fine...
|
||||||
rv = copyattr(frompath,topath);
|
rv = copyattr(frompath,topath);
|
||||||
if(rv == -1 && errno != ENOTTY)
|
if(rv == -1 && !ignorable_error(errno))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
rv = copyxattrs(frompath,topath);
|
rv = copyxattrs(frompath,topath);
|
||||||
if(rv == -1 && errno != ENOTTY)
|
if(rv == -1 && !ignorable_error(errno))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user