Skip to content

Commit cca7b7c

Browse files
xiaoxiang781216GUIDINGLI
authored andcommitted
fs/romfs: romfs_read return the partail read size instead error code
Signed-off-by: Xiang Xiao <[email protected]>
1 parent 9690084 commit cca7b7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/romfs/fs_romfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
492492

493493
errout_with_lock:
494494
nxrmutex_unlock(&rm->rm_lock);
495-
return ret < 0 ? ret : readsize;
495+
return readsize ? readsize : ret;
496496
}
497497

498498
/****************************************************************************

0 commit comments

Comments
 (0)