af_bluetooth.c (1136fa0c07de570dc17858745af8be169d1440ba) | af_bluetooth.c (da8912176fb0ff9fd60e14fa653108d96422b896) |
---|---|
1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 Copyright (C) 2000-2001 Qualcomm Incorporated 4 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 554 unchanged lines hidden (view full) --- 563 } 564 __set_current_state(TASK_RUNNING); 565 remove_wait_queue(sk_sleep(sk), &wait); 566 return err; 567} 568EXPORT_SYMBOL(bt_sock_wait_state); 569 570/* This function expects the sk lock to be held when called */ | 1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 Copyright (C) 2000-2001 Qualcomm Incorporated 4 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 554 unchanged lines hidden (view full) --- 563 } 564 __set_current_state(TASK_RUNNING); 565 remove_wait_queue(sk_sleep(sk), &wait); 566 return err; 567} 568EXPORT_SYMBOL(bt_sock_wait_state); 569 570/* This function expects the sk lock to be held when called */ |
571int bt_sock_wait_ready(struct sock *sk, unsigned long flags) | 571int bt_sock_wait_ready(struct sock *sk, unsigned int msg_flags) |
572{ 573 DECLARE_WAITQUEUE(wait, current); 574 unsigned long timeo; 575 int err = 0; 576 577 BT_DBG("sk %p", sk); 578 | 572{ 573 DECLARE_WAITQUEUE(wait, current); 574 unsigned long timeo; 575 int err = 0; 576 577 BT_DBG("sk %p", sk); 578 |
579 timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); | 579 timeo = sock_sndtimeo(sk, !!(msg_flags & MSG_DONTWAIT)); |
580 581 add_wait_queue(sk_sleep(sk), &wait); 582 set_current_state(TASK_INTERRUPTIBLE); 583 while (test_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags)) { 584 if (!timeo) { 585 err = -EAGAIN; 586 break; 587 } --- 217 unchanged lines hidden --- | 580 581 add_wait_queue(sk_sleep(sk), &wait); 582 set_current_state(TASK_INTERRUPTIBLE); 583 while (test_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags)) { 584 if (!timeo) { 585 err = -EAGAIN; 586 break; 587 } --- 217 unchanged lines hidden --- |