mirror of
https://github.com/apache/nuttx.git
synced 2026-05-19 11:53:25 +08:00
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:
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user