hostfs:ioctl should return -ENOTTY when the instruction is incompatible
When sending FIOC_XXXLK to hostfs, hostfs will return -1 by default. For ioctl statements, incompatible instructions should be processed as -ENOTTY by default Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
parent
6e9a43c504
commit
def05ebabb
@ -604,15 +604,22 @@ static int hostfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
/* Call our internal routine to perform the ioctl */
|
||||
|
||||
ret = host_ioctl(hf->fd, cmd, arg);
|
||||
|
||||
if (ret < 0 && cmd == FIOC_FILEPATH)
|
||||
if (ret < 0)
|
||||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case FIOC_FILEPATH:
|
||||
FAR char *path = (FAR char *)(uintptr_t)arg;
|
||||
ret = inode_getpath(filep->f_inode, path, PATH_MAX);
|
||||
if (ret >= 0)
|
||||
{
|
||||
strlcat(path, hf->relpath, PATH_MAX);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
}
|
||||
}
|
||||
|
||||
nxmutex_unlock(&g_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user