mirror of
https://github.com/apache/nuttx.git
synced 2026-06-09 10:54:43 +08:00
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:
+12
-5
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user