From: Johan Hedberg Date: Mon, 16 Sep 2013 10:05:19 +0000 (+0300) Subject: Bluetooth: Fix waiting for clearing of BT_SK_SUSPEND flag X-Git-Tag: v3.13-rc1~105^2~225^2~24^2~51 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e793dcf082c847bd2b742c781252c20cbec37986;p=pandora-kernel.git Bluetooth: Fix waiting for clearing of BT_SK_SUSPEND flag In the case of blocking sockets we should not proceed with sendmsg() if the socket has the BT_SK_SUSPEND flag set. So far the code was only ensuring that POLLOUT doesn't get set for non-blocking sockets using poll() but there was no code in place to ensure that blocking sockets do the right thing when writing to them. This patch adds a new bt_sock_wait_ready helper function to sleep in the sendmsg call if the BT_SK_SUSPEND flag is set, and wake up as soon as it is unset. It also updates the L2CAP and RFCOMM sendmsg callbacks to take advantage of this new helper function. Signed-off-by: Johan Hedberg Acked-by: Marcel Holtmann Signed-off-by: Gustavo Padovan --- Reading git-diff-tree failed