mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-25 21:24:16 +08:00
Fix return value check for bt_audio_service_open()
Only negative values (namely -1) are errors for this function.
This commit is contained in:
parent
e40bc80bf5
commit
5bd311398e
@ -1448,7 +1448,7 @@ static gboolean gst_avdtp_sink_start(GstBaseSink *basesink)
|
||||
self->watch_id = 0;
|
||||
|
||||
sk = bt_audio_service_open();
|
||||
if (sk <= 0) {
|
||||
if (sk < 0) {
|
||||
err = -errno;
|
||||
GST_ERROR_OBJECT(self, "Cannot open connection to bt "
|
||||
"audio service: %s %d", strerror(-err), -err);
|
||||
|
@ -1666,7 +1666,7 @@ static int bluetooth_init(struct bluetooth_data *data,
|
||||
data->stream.fd = -1;
|
||||
|
||||
sk = bt_audio_service_open();
|
||||
if (sk <= 0) {
|
||||
if (sk < 0) {
|
||||
err = -errno;
|
||||
goto failed;
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ static int init_bt(struct userdata *u)
|
||||
DBG("bt_audio_service_open");
|
||||
|
||||
u->service_fd = bt_audio_service_open();
|
||||
if (u->service_fd <= 0) {
|
||||
if (u->service_fd < 0) {
|
||||
int err = -errno;
|
||||
|
||||
ERR("bt_audio_service_open() failed: %s (%d)", strerror(-err),
|
||||
|
Loading…
Reference in New Issue
Block a user