exfatfs_seek: return current location plus offset bytes when whence is SEEK_CUR

VELAPLATFO-195 VELAPLATFO-194

Change-Id: Ic81d3169f948e70ed5f87fca1b78ce5905f59c98
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong
2021-08-31 11:17:20 +08:00
parent af3d84cb19
commit 85e5bff276
+12 -5
View File
@@ -463,16 +463,23 @@ static off_t exfatfs_seek(FAR struct file *filep, off_t offset, int whence)
switch (whence)
{
case SEEK_SET:
filep->f_pos = offset;
break;
case SEEK_CUR:
offset += filep->f_pos;
case SEEK_SET:
if (offset >= 0)
{
filep->f_pos = offset;
}
else
{
ret = -EINVAL;
}
break;
case SEEK_END:
filep->f_pos = priv->node->size;
filep->f_pos = priv->node->size + offset;
break;
default: