diff options
author | David S. Miller <davem@davemloft.net> | 2009-04-30 05:30:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-30 05:30:35 +0200 |
commit | aba7453037c3a90714caae77a622dceaf1173786 (patch) | |
tree | bf07f9f432b0d8e9db9486f1f32ad065c0aa7c5c /net/core | |
parent | Revert "vxge: use max() instead of VXGE_HW_SET_LEVEL" (diff) | |
parent | mv643xx_eth: 64bit mib counter read fix (diff) | |
download | linux-aba7453037c3a90714caae77a622dceaf1173786.tar.xz linux-aba7453037c3a90714caae77a622dceaf1173786.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
Documentation/isdn/00-INDEX
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/rndis_wlan.c
net/mac80211/main.c
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/datagram.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c index 914d5fa773b4..22ea437c5023 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -64,13 +64,25 @@ static inline int connection_based(struct sock *sk) return sk->sk_type == SOCK_SEQPACKET || sk->sk_type == SOCK_STREAM; } +static int receiver_wake_function(wait_queue_t *wait, unsigned mode, int sync, + void *key) +{ + unsigned long bits = (unsigned long)key; + + /* + * Avoid a wakeup if event not interesting for us + */ + if (bits && !(bits & (POLLIN | POLLERR))) + return 0; + return autoremove_wake_function(wait, mode, sync, key); +} /* * Wait for a packet.. */ static int wait_for_packet(struct sock *sk, int *err, long *timeo_p) { int error; - DEFINE_WAIT(wait); + DEFINE_WAIT_FUNC(wait, receiver_wake_function); prepare_to_wait_exclusive(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); |