From 45c62dfde68daae955fe44d76bca794c69f3121e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 20 May 2020 13:43:44 +0200 Subject: [PATCH] a2dp: check and log return value of fcntl --- spa/plugins/bluez5/a2dp-source.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/bluez5/a2dp-source.c b/spa/plugins/bluez5/a2dp-source.c index 448012a4f..2aa114e91 100644 --- a/spa/plugins/bluez5/a2dp-source.c +++ b/spa/plugins/bluez5/a2dp-source.c @@ -463,7 +463,8 @@ static int transport_start(struct impl *this) this->transport->configuration_len); val = fcntl(this->transport->fd, F_GETFL); - fcntl(this->transport->fd, F_SETFL, val | O_NONBLOCK); + if (fcntl(this->transport->fd, F_SETFL, val | O_NONBLOCK) < 0) + spa_log_warn(this->log, NAME" %p: fcntl %u %m", this, val | O_NONBLOCK); val = FILL_FRAMES * this->transport->write_mtu; if (setsockopt(this->transport->fd, SOL_SOCKET, SO_SNDBUF, &val, sizeof(val)) < 0)