bluez5: fix wrong use of F_GETFL and F_SETFL

The pattern is to F_GETFL the flags, then clear the NONBLOCK flag and
then F_SETFL the new flags.
This commit is contained in:
Wim Taymans 2026-05-06 12:22:39 +02:00
parent 195c048d1c
commit d33466a340

View file

@ -2765,13 +2765,13 @@ static void sco_ready(struct spa_bt_transport *t)
}
/* Clear nonblocking flag we set for connect() */
err = fcntl(t->fd, F_GETFL, O_NONBLOCK);
err = fcntl(t->fd, F_GETFL);
if (err < 0) {
td->err = -errno;
goto done;
}
err &= ~O_NONBLOCK;
err = fcntl(t->fd, F_SETFL, O_NONBLOCK, err);
err = fcntl(t->fd, F_SETFL, err);
if (err < 0) {
td->err = -errno;
goto done;