Browse Source

Merge pull request #83 from trapexit/enotsup

ignore ENOTSUP errors when cloning paths. fixes #82
pull/85/head 2.1.1
Antonio SJ Musumeci 9 years ago
parent
commit
e4be3aac2a
  1. 21
      src/fs.cpp

21
src/fs.cpp

@ -420,6 +420,23 @@ namespace fs
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
clonepath(const string &fromsrc,
const string &tosrc,
@ -464,11 +481,11 @@ namespace fs
// It may not support it... it's fine...
rv = copyattr(frompath,topath);
if(rv == -1 && errno != ENOTTY)
if(rv == -1 && !ignorable_error(errno))
return -1;
rv = copyxattrs(frompath,topath);
if(rv == -1 && errno != ENOTTY)
if(rv == -1 && !ignorable_error(errno))
return -1;
return 0;

Loading…
Cancel
Save