summaryrefslogtreecommitdiff
path: root/pflocal/sock.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-07-22 17:08:21 +0000
committerMiles Bader <miles@gnu.org>1995-07-22 17:08:21 +0000
commit0823f8f4e23c28c1f435e63621402fb9bd2a2a1d (patch)
tree3941346b92455af7367b1f639d966053f3c31e49 /pflocal/sock.c
parent77ad21c2d3a5780bc71184423de9b20f977fa293 (diff)
Formerly sock.c.~12~
Diffstat (limited to 'pflocal/sock.c')
-rw-r--r--pflocal/sock.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pflocal/sock.c b/pflocal/sock.c
index 3f281d35..0b8585ea 100644
--- a/pflocal/sock.c
+++ b/pflocal/sock.c
@@ -490,13 +490,16 @@ debug (sock1, "out");
void
sock_shutdown (struct sock *sock, unsigned flags)
{
+ unsigned old_flags;
+
debug (sock, "in");
debug (sock, "lock");
mutex_lock (&sock->lock);
+ old_flags = sock->flags;
sock->flags |= flags;
- if (flags & SOCK_SHUTDOWN_READ)
+ if (flags & SOCK_SHUTDOWN_READ && !(old_flags & SOCK_SHUTDOWN_READ))
/* Shutdown the read half. We keep the pipe around though. */
{
struct pipe *pipe = sock->read_pipe;
@@ -511,7 +514,7 @@ debug (pipe, "(pipe) unlock");
mutex_unlock (&pipe->lock);
}
- if (flags & SOCK_SHUTDOWN_WRITE)
+ if (flags & SOCK_SHUTDOWN_WRITE && !(old_flags & SOCK_SHUTDOWN_WRITE))
/* Shutdown the write half. */
{
struct pipe *pipe = sock->write_pipe;
@@ -551,7 +554,7 @@ sock_global_init ()
error_t
sock_global_shutdown ()
{
- int num_ports = ports_count_bucket (sock_user_bucket);
- ports_enable_bucket (sock_user_bucket);
+ int num_ports = ports_count_bucket (sock_port_bucket);
+ ports_enable_bucket (sock_port_bucket);
return (num_ports == 0 ? 0 : EBUSY);
}