mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-26 21:54:33 +08:00
android/socket: Fix errno handling in rfsock_set_buffer
This commit is contained in:
parent
30806e2eb9
commit
0fad8a94a1
@ -102,14 +102,16 @@ static int rfsock_set_buffer(struct rfcomm_sock *rfsock)
|
||||
|
||||
err = getsockopt(rfsock->bt_sock, SOL_SOCKET, SO_RCVBUF, &rcv, &len);
|
||||
if (err < 0) {
|
||||
error("getsockopt(SO_RCVBUF): %s", strerror(errno));
|
||||
return -errno;
|
||||
int err = -errno;
|
||||
error("getsockopt(SO_RCVBUF): %s", strerror(-err));
|
||||
return err;
|
||||
}
|
||||
|
||||
err = getsockopt(rfsock->bt_sock, SOL_SOCKET, SO_SNDBUF, &snd, &len);
|
||||
if (err < 0) {
|
||||
error("getsockopt(SO_SNDBUF): %s", strerror(errno));
|
||||
return -errno;
|
||||
int err = -errno;
|
||||
error("getsockopt(SO_SNDBUF): %s", strerror(-err));
|
||||
return err;
|
||||
}
|
||||
|
||||
size = MAX(rcv, snd);
|
||||
|
Loading…
Reference in New Issue
Block a user