Fix my stupid compile bug in num_files_open.
authorJeremy Allison <jra@samba.org>
Tue, 23 Apr 2002 18:34:52 +0000 (18:34 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 23 Apr 2002 18:34:52 +0000 (18:34 +0000)
Jeremy.
(This used to be commit 7c02db7c4f0d04b7c45a9c580f3e85f52fa505d5)

source3/rpc_server/srv_pipe_hnd.c

index 4b20ee5558b2481ee76005417e162ae2aba971a0..a4a9e85ae46ff5421ed33ab17aa4786ef80ec680 100644 (file)
@@ -240,9 +240,6 @@ smb_np_struct *open_rpc_pipe_p(char *pipe_name,
        for (p_it = Pipes; p_it; p_it = p_it->next)
                DEBUG(5,("open pipes: name %s pnum=%x\n", p_it->name, p_it->pnum));  
 
-       /* Ensure the connection isn't idled whilst this pipe is open. */
-       conn->num_files_open++;
-
        return chain_p;
 }
 
@@ -301,6 +298,10 @@ static void *make_internal_rpc_pipe_p(char *pipe_name,
        DLIST_ADD(InternalPipes, p);
 
        p->conn = conn;
+
+       /* Ensure the connection isn't idled whilst this pipe is open. */
+       p->conn->num_files_open++;
+
        p->vuid  = vuid;
 
        p->ntlmssp_chal_flags = 0;
@@ -1059,8 +1060,6 @@ BOOL close_rpc_pipe_hnd(smb_np_struct *p)
 
        SAFE_FREE(p);
 
-       conn->num_files_open--;
-
        return True;
 }
 
@@ -1090,6 +1089,8 @@ static BOOL close_internal_rpc_pipe_hnd(void *np_conn)
 
        DLIST_REMOVE(InternalPipes, p);
 
+       p->conn->num_files_open--;
+
        ZERO_STRUCTP(p);
 
        SAFE_FREE(p);