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:
parent
386dbfa449
commit
d81a28097a
1 changed files with 1 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ static ssize_t btuart_read(FAR struct btuart_upperhalf_s *upper,
|
|||
else if (nread < 0)
|
||||
{
|
||||
wlwarn("Returned error %zd\n", nread);
|
||||
return nread;
|
||||
return ntotal > 0 ? ntotal : nread;
|
||||
}
|
||||
|
||||
wlinfo("read %zd remaining %zu\n", nread, buflen - nread);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue