mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
btuart_read and returned the correct value.
When the nread return value < 0, if the total length ntotal that has been read is > 0, the function returns ntotal; otherwise, it returns the nread error code. Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
386dbfa449
commit
d81a28097a
@@ -86,7 +86,7 @@ static ssize_t btuart_read(FAR struct btuart_upperhalf_s *upper,
|
|||||||
else if (nread < 0)
|
else if (nread < 0)
|
||||||
{
|
{
|
||||||
wlwarn("Returned error %zd\n", nread);
|
wlwarn("Returned error %zd\n", nread);
|
||||||
return nread;
|
return ntotal > 0 ? ntotal : nread;
|
||||||
}
|
}
|
||||||
|
|
||||||
wlinfo("read %zd remaining %zu\n", nread, buflen - nread);
|
wlinfo("read %zd remaining %zu\n", nread, buflen - nread);
|
||||||
|
|||||||
Reference in New Issue
Block a user