fs_fsync.c:Fix unknown command message in non-block device situations

This command is called only if the device is a block device or mtd
device.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2023-08-02 21:55:39 +08:00 committed by Xiang Xiao
parent 1bd2595be8
commit 35602cc2ef

View File

@ -75,7 +75,8 @@ int file_fsync(FAR struct file *filep)
}
else
#endif
if (inode->u.i_ops && inode->u.i_ops->ioctl)
if ((INODE_IS_BLOCK(inode) || INODE_IS_MTD(inode)) &&
inode->u.i_ops && inode->u.i_ops->ioctl)
{
ret = inode->u.i_ops->ioctl(filep, BIOC_FLUSH, 0);
return ret >= 0 ? 0 : ret;