fs/romfs: romfs_read return the partail read size instead error code

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2024-07-28 15:42:26 +08:00 • committed by GUIDINGLI
parent 96900845a5
commit cca7b7cb37

View file

@ -492,7 +492,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
errout_with_lock:
nxrmutex_unlock(&rm->rm_lock);
return ret < 0 ? ret : readsize;
return readsize ? readsize : ret;
}
/****************************************************************************