From eee4d4133d6f7ccbda6bbddfabf7746054ad36d1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 7 Feb 2000 02:25:57 +0000 Subject: 2000-02-06 Roland McGrath * socket.c (make_sock_user): Take new argument CONSUME. * pfinet.h: Update decl. * io-ops.c (S_io_reauthenticate, S_io_restrict_auth, S_io_duplicate): Callers changed, these all pass false. * socket-ops.c (S_socket_create, S_socket_accept): Callers changed, these ones pass true. --- pfinet/socket.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pfinet/socket.c') diff --git a/pfinet/socket.c b/pfinet/socket.c index 52bd37ff..82935a57 100644 --- a/pfinet/socket.c +++ b/pfinet/socket.c @@ -59,9 +59,10 @@ sock_alloc (void) } /* Create a sock_user structure, initialized from SOCK and ISROOT. - If NOINSTALL is set, don't put it in the portset. */ + If NOINSTALL is set, don't put it in the portset. + We increment SOCK->refcnt iff CONSUME is zero. */ struct sock_user * -make_sock_user (struct socket *sock, int isroot, int noinstall) +make_sock_user (struct socket *sock, int isroot, int noinstall, int consume) { error_t err; struct sock_user *user; @@ -81,7 +82,8 @@ make_sock_user (struct socket *sock, int isroot, int noinstall) in the original Linux structure), because there can be multiple ports (struct sock_user, aka protids) pointing to the same socket. The socket lives until all the ports die. */ - ++sock->refcnt; + if (! consume) + ++sock->refcnt; user->isroot = isroot; user->sock = sock; return user; -- cgit v1.2.3