aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-09-22 19:49:27 -0400
committerAnton Vorontsov <avorontsov@ru.mvista.com>2009-09-22 19:49:27 -0400
commitf056878332a91ed984a116bad4e7d49aefff9e6e (patch)
tree572f4757c8e7811d45e0be0c2ae529c78fb63441 /net/unix/af_unix.c
parent3961f7c3cf247eee5df7fabadc7a40f2deeb98f3 (diff)
parent7fa07729e439a6184bd824746d06a49cca553f15 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/power/wm97xx_battery.c
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 36d4e44d6233..51ab497115eb 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -315,7 +315,7 @@ static void unix_write_space(struct sock *sk)
315{ 315{
316 read_lock(&sk->sk_callback_lock); 316 read_lock(&sk->sk_callback_lock);
317 if (unix_writable(sk)) { 317 if (unix_writable(sk)) {
318 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 318 if (sk_has_sleeper(sk))
319 wake_up_interruptible_sync(sk->sk_sleep); 319 wake_up_interruptible_sync(sk->sk_sleep);
320 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 320 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
321 } 321 }
@@ -1501,6 +1501,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
1501 struct sk_buff *skb; 1501 struct sk_buff *skb;
1502 int sent = 0; 1502 int sent = 0;
1503 struct scm_cookie tmp_scm; 1503 struct scm_cookie tmp_scm;
1504 bool fds_sent = false;
1504 1505
1505 if (NULL == siocb->scm) 1506 if (NULL == siocb->scm)
1506 siocb->scm = &tmp_scm; 1507 siocb->scm = &tmp_scm;
@@ -1562,12 +1563,14 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
1562 size = min_t(int, size, skb_tailroom(skb)); 1563 size = min_t(int, size, skb_tailroom(skb));
1563 1564
1564 memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred)); 1565 memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
1565 if (siocb->scm->fp) { 1566 /* Only send the fds in the first buffer */
1567 if (siocb->scm->fp && !fds_sent) {
1566 err = unix_attach_fds(siocb->scm, skb); 1568 err = unix_attach_fds(siocb->scm, skb);
1567 if (err) { 1569 if (err) {
1568 kfree_skb(skb); 1570 kfree_skb(skb);
1569 goto out_err; 1571 goto out_err;
1570 } 1572 }
1573 fds_sent = true;
1571 } 1574 }
1572 1575
1573 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); 1576 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
@@ -1985,7 +1988,7 @@ static unsigned int unix_poll(struct file *file, struct socket *sock, poll_table
1985 struct sock *sk = sock->sk; 1988 struct sock *sk = sock->sk;
1986 unsigned int mask; 1989 unsigned int mask;
1987 1990
1988 poll_wait(file, sk->sk_sleep, wait); 1991 sock_poll_wait(file, sk->sk_sleep, wait);
1989 mask = 0; 1992 mask = 0;
1990 1993
1991 /* exceptional events? */ 1994 /* exceptional events? */
@@ -2022,7 +2025,7 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
2022 struct sock *sk = sock->sk, *other; 2025 struct sock *sk = sock->sk, *other;
2023 unsigned int mask, writable; 2026 unsigned int mask, writable;
2024 2027
2025 poll_wait(file, sk->sk_sleep, wait); 2028 sock_poll_wait(file, sk->sk_sleep, wait);
2026 mask = 0; 2029 mask = 0;
2027 2030
2028 /* exceptional events? */ 2031 /* exceptional events? */
@@ -2053,7 +2056,7 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
2053 other = unix_peer_get(sk); 2056 other = unix_peer_get(sk);
2054 if (other) { 2057 if (other) {
2055 if (unix_peer(other) != sk) { 2058 if (unix_peer(other) != sk) {
2056 poll_wait(file, &unix_sk(other)->peer_wait, 2059 sock_poll_wait(file, &unix_sk(other)->peer_wait,
2057 wait); 2060 wait);
2058 if (unix_recvq_full(other)) 2061 if (unix_recvq_full(other))
2059 writable = 0; 2062 writable = 0;