Commit 7180a031 authored by Alban Crequy's avatar Alban Crequy Committed by David S. Miller

af_unix: coding style: remove one level of indentation in unix_shutdown()

Signed-off-by: default avatarAlban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: default avatarIan Molton <ian.molton@collabora.co.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8970f0b
...@@ -1984,36 +1984,38 @@ static int unix_shutdown(struct socket *sock, int mode) ...@@ -1984,36 +1984,38 @@ static int unix_shutdown(struct socket *sock, int mode)
mode = (mode+1)&(RCV_SHUTDOWN|SEND_SHUTDOWN); mode = (mode+1)&(RCV_SHUTDOWN|SEND_SHUTDOWN);
if (mode) { if (!mode)
unix_state_lock(sk); return 0;
sk->sk_shutdown |= mode;
other = unix_peer(sk); unix_state_lock(sk);
if (other) sk->sk_shutdown |= mode;
sock_hold(other); other = unix_peer(sk);
unix_state_unlock(sk); if (other)
sk->sk_state_change(sk); sock_hold(other);
unix_state_unlock(sk);
if (other && sk->sk_state_change(sk);
(sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET)) {
if (other &&
int peer_mode = 0; (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET)) {
if (mode&RCV_SHUTDOWN) int peer_mode = 0;
peer_mode |= SEND_SHUTDOWN;
if (mode&SEND_SHUTDOWN) if (mode&RCV_SHUTDOWN)
peer_mode |= RCV_SHUTDOWN; peer_mode |= SEND_SHUTDOWN;
unix_state_lock(other); if (mode&SEND_SHUTDOWN)
other->sk_shutdown |= peer_mode; peer_mode |= RCV_SHUTDOWN;
unix_state_unlock(other); unix_state_lock(other);
other->sk_state_change(other); other->sk_shutdown |= peer_mode;
if (peer_mode == SHUTDOWN_MASK) unix_state_unlock(other);
sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP); other->sk_state_change(other);
else if (peer_mode & RCV_SHUTDOWN) if (peer_mode == SHUTDOWN_MASK)
sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN); sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP);
} else if (peer_mode & RCV_SHUTDOWN)
if (other) sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN);
sock_put(other);
} }
if (other)
sock_put(other);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment