make fs::attr return ENOTSUP on EINVAL #381

This commit is contained in:
Antonio SJ Musumeci 2017-04-03 21:11:20 -04:00
parent 3728e39655
commit c043ef95a3
2 changed files with 16 additions and 4 deletions

View file

@ -35,7 +35,13 @@ namespace fs
get_fs_ioc_flags(const int fd,
int &flags)
{
return fs::ioctl(fd,FS_IOC_GETFLAGS,(void*)&flags);
int rv;
rv = fs::ioctl(fd,FS_IOC_GETFLAGS,(void*)&flags);
if((rv == -1) && (errno == EINVAL))
errno = ENOTSUP;
return rv;
}
static
@ -68,7 +74,13 @@ namespace fs
set_fs_ioc_flags(const int fd,
const int flags)
{
return fs::ioctl(fd,FS_IOC_SETFLAGS,(void*)&flags);
int rv;
rv = fs::ioctl(fd,FS_IOC_SETFLAGS,(void*)&flags);
if((rv == -1) && (errno == EINVAL))
errno = ENOTSUP;
return rv;
}
static