aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-10-04 16:57:00 -0400
committerArnd Bergmann <arnd@arndb.de>2012-10-04 16:57:51 -0400
commitc37d6154c0b9163c27e53cc1d0be3867b4abd760 (patch)
tree7a24522c56d1cb284dff1d3c225bbdaba0901bb5 /net/unix/af_unix.c
parente7a570ff7dff9af6e54ff5e580a61ec7652137a0 (diff)
parent8a1ab3155c2ac7fbe5f2038d6e26efeb607a1498 (diff)
Merge branch 'disintegrate-asm-generic' of git://git.infradead.org/users/dhowells/linux-headers into asm-generic
Patches from David Howells <dhowells@redhat.com>: This is to complete part of the UAPI disintegration for which the preparatory patches were pulled recently. Note that there are some fixup patches which are at the base of the branch aimed at you, plus all arches get the asm-generic branch merged in too. * 'disintegrate-asm-generic' of git://git.infradead.org/users/dhowells/linux-headers: UAPI: (Scripted) Disintegrate include/asm-generic UAPI: Fix conditional header installation handling (notably kvm_para.h on m68k) c6x: remove c6x signal.h UAPI: Split compound conditionals containing __KERNEL__ in Arm64 UAPI: Fix the guards on various asm/unistd.h files Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index c5ee4ff61364..5b5c876c80e9 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -441,7 +441,7 @@ static int unix_release_sock(struct sock *sk, int embrion)
441 /* ---- Socket is dead now and most probably destroyed ---- */ 441 /* ---- Socket is dead now and most probably destroyed ---- */
442 442
443 /* 443 /*
444 * Fixme: BSD difference: In BSD all sockets connected to use get 444 * Fixme: BSD difference: In BSD all sockets connected to us get
445 * ECONNRESET and we die on the spot. In Linux we behave 445 * ECONNRESET and we die on the spot. In Linux we behave
446 * like files and pipes do and wait for the last 446 * like files and pipes do and wait for the last
447 * dereference. 447 * dereference.
@@ -481,7 +481,6 @@ static int unix_listen(struct socket *sock, int backlog)
481 struct sock *sk = sock->sk; 481 struct sock *sk = sock->sk;
482 struct unix_sock *u = unix_sk(sk); 482 struct unix_sock *u = unix_sk(sk);
483 struct pid *old_pid = NULL; 483 struct pid *old_pid = NULL;
484 const struct cred *old_cred = NULL;
485 484
486 err = -EOPNOTSUPP; 485 err = -EOPNOTSUPP;
487 if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET) 486 if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET)
@@ -503,8 +502,6 @@ static int unix_listen(struct socket *sock, int backlog)
503out_unlock: 502out_unlock:
504 unix_state_unlock(sk); 503 unix_state_unlock(sk);
505 put_pid(old_pid); 504 put_pid(old_pid);
506 if (old_cred)
507 put_cred(old_cred);
508out: 505out:
509 return err; 506 return err;
510} 507}
@@ -2060,10 +2057,14 @@ static int unix_shutdown(struct socket *sock, int mode)
2060 struct sock *sk = sock->sk; 2057 struct sock *sk = sock->sk;
2061 struct sock *other; 2058 struct sock *other;
2062 2059
2063 mode = (mode+1)&(RCV_SHUTDOWN|SEND_SHUTDOWN); 2060 if (mode < SHUT_RD || mode > SHUT_RDWR)
2064 2061 return -EINVAL;
2065 if (!mode) 2062 /* This maps:
2066 return 0; 2063 * SHUT_RD (0) -> RCV_SHUTDOWN (1)
2064 * SHUT_WR (1) -> SEND_SHUTDOWN (2)
2065 * SHUT_RDWR (2) -> SHUTDOWN_MASK (3)
2066 */
2067 ++mode;
2067 2068
2068 unix_state_lock(sk); 2069 unix_state_lock(sk);
2069 sk->sk_shutdown |= mode; 2070 sk->sk_shutdown |= mode;