diff options
Diffstat (limited to 'net/unix')
| -rw-r--r-- | net/unix/af_unix.c | 21 | 
1 files changed, 10 insertions, 11 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index fa906ec5e657..d5f10783c251 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -755,7 +755,7 @@ static int unix_bind(struct socket *, struct sockaddr *, int);  static int unix_stream_connect(struct socket *, struct sockaddr *,  			       int addr_len, int flags);  static int unix_socketpair(struct socket *, struct socket *); -static int unix_accept(struct socket *, struct socket *, int, bool); +static int unix_accept(struct socket *, struct socket *, struct proto_accept_arg *arg);  static int unix_getname(struct socket *, struct sockaddr *, int);  static __poll_t unix_poll(struct file *, struct socket *, poll_table *);  static __poll_t unix_dgram_poll(struct file *, struct socket *, @@ -1689,19 +1689,18 @@ static void unix_sock_inherit_flags(const struct socket *old,  		set_bit(SOCK_PASSSEC, &new->flags);  } -static int unix_accept(struct socket *sock, struct socket *newsock, int flags, -		       bool kern) +static int unix_accept(struct socket *sock, struct socket *newsock, +		       struct proto_accept_arg *arg)  {  	struct sock *sk = sock->sk;  	struct sk_buff *skb;  	struct sock *tsk; -	int err; -	err = -EOPNOTSUPP; +	arg->err = -EOPNOTSUPP;  	if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET)  		goto out; -	err = -EINVAL; +	arg->err = -EINVAL;  	if (sk->sk_state != TCP_LISTEN)  		goto out; @@ -1709,12 +1708,12 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags,  	 * so that no locks are necessary.  	 */ -	skb = skb_recv_datagram(sk, (flags & O_NONBLOCK) ? MSG_DONTWAIT : 0, -				&err); +	skb = skb_recv_datagram(sk, (arg->flags & O_NONBLOCK) ? MSG_DONTWAIT : 0, +				&arg->err);  	if (!skb) {  		/* This means receive shutdown. */ -		if (err == 0) -			err = -EINVAL; +		if (arg->err == 0) +			arg->err = -EINVAL;  		goto out;  	} @@ -1732,7 +1731,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags,  	return 0;  out: -	return err; +	return arg->err;  }  | 
