Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57436
b: refs/heads/master
c: 3c0d2f3
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and David S. Miller committed Jun 7, 2007
1 parent 6e3d5d7 commit e666b23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c764c9ade6d9b710bad2b9c631ede9864333b98c
refs/heads/master: 3c0d2f3780fc94746c4842e965bd2570e2119bb6
13 changes: 10 additions & 3 deletions trunk/net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,20 +1744,23 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
int chunk;
struct sk_buff *skb;

unix_state_lock(sk);
skb = skb_dequeue(&sk->sk_receive_queue);
if (skb==NULL)
{
if (copied >= target)
break;
goto unlock;

/*
* POSIX 1003.1g mandates this order.
*/

if ((err = sock_error(sk)) != 0)
break;
goto unlock;
if (sk->sk_shutdown & RCV_SHUTDOWN)
break;
goto unlock;

unix_state_unlock(sk);
err = -EAGAIN;
if (!timeo)
break;
Expand All @@ -1771,7 +1774,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
}
mutex_lock(&u->readlock);
continue;
unlock:
unix_state_unlock(sk);
break;
}
unix_state_unlock(sk);

if (check_creds) {
/* Never glue messages from different writers */
Expand Down

0 comments on commit e666b23

Please sign in to comment.