aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-10 17:26:00 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-10 17:26:00 -0500
commit33175d84ee3fa29991adb80513683e010769e807 (patch)
tree3731f61cf82451b6892cf1368701e57e35d92908 /net/unix
parentc5908939b2738bafe1b309bc2465cb9f2e6184c5 (diff)
parent6dfbd87a20a737641ef228230c77f4262434fa24 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/bnx2x/bnx2x_cmn.c
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index df5997d25826..de870184e457 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1728,7 +1728,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
1728 1728
1729 msg->msg_namelen = 0; 1729 msg->msg_namelen = 0;
1730 1730
1731 mutex_lock(&u->readlock); 1731 err = mutex_lock_interruptible(&u->readlock);
1732 if (err) {
1733 err = sock_intr_errno(sock_rcvtimeo(sk, noblock));
1734 goto out;
1735 }
1732 1736
1733 skb = skb_recv_datagram(sk, flags, noblock, &err); 1737 skb = skb_recv_datagram(sk, flags, noblock, &err);
1734 if (!skb) { 1738 if (!skb) {
@@ -1868,7 +1872,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
1868 memset(&tmp_scm, 0, sizeof(tmp_scm)); 1872 memset(&tmp_scm, 0, sizeof(tmp_scm));
1869 } 1873 }
1870 1874
1871 mutex_lock(&u->readlock); 1875 err = mutex_lock_interruptible(&u->readlock);
1876 if (err) {
1877 err = sock_intr_errno(timeo);
1878 goto out;
1879 }
1872 1880
1873 do { 1881 do {
1874 int chunk; 1882 int chunk;
@@ -1899,11 +1907,12 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
1899 1907
1900 timeo = unix_stream_data_wait(sk, timeo); 1908 timeo = unix_stream_data_wait(sk, timeo);
1901 1909
1902 if (signal_pending(current)) { 1910 if (signal_pending(current)
1911 || mutex_lock_interruptible(&u->readlock)) {
1903 err = sock_intr_errno(timeo); 1912 err = sock_intr_errno(timeo);
1904 goto out; 1913 goto out;
1905 } 1914 }
1906 mutex_lock(&u->readlock); 1915
1907 continue; 1916 continue;
1908 unlock: 1917 unlock:
1909 unix_state_unlock(sk); 1918 unix_state_unlock(sk);