Browse Source

ignore ENOTSUP errors when cloning paths. fixes #82

pull/83/head
Antonio SJ Musumeci 9 years ago
parent
commit
4d605388a4
  1. 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…
Cancel
Save