diff options
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_lsa_hnd.c | 17 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 17 |
2 files changed, 4 insertions, 30 deletions
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c index 2fc2c73ea3..d65116e646 100644 --- a/source3/rpc_server/srv_lsa_hnd.c +++ b/source3/rpc_server/srv_lsa_hnd.c @@ -124,14 +124,7 @@ BOOL open_lsa_policy_hnd(POLICY_HND *hnd) bitmap_set(bmap, i); - /* hook into the front of the list */ - if (!Policy) { - Policy = p; - } else { - Policy->prev = p; - p->next = Policy; - Policy = p; - } + DLIST_ADD(Policy, p); DEBUG(4,("Opened policy hnd[%x] ", i)); dump_data(4, (char *)hnd->data, sizeof(hnd->data)); @@ -303,13 +296,7 @@ BOOL close_lsa_policy_hnd(POLICY_HND *hnd) DEBUG(3,("Closed policy name pnum=%x\n", p->pnum)); - if (p == Policy) { - Policy = p->next; - if (Policy) Policy->prev = NULL; - } else { - p->prev->next = p->next; - if (p->next) p->next->prev = p->prev; - } + DLIST_REMOVE(Policy, p); bitmap_clear(bmap, p->pnum); diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 368bf013a0..b030ee0e90 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -91,14 +91,7 @@ pipes_struct *open_rpc_pipe_p(char *pipe_name, p = (pipes_struct *)malloc(sizeof(*p)); if (!p) return NULL; - /* hook into the front of the list */ - if (!Pipes) { - Pipes = p; - } else { - Pipes->prev = p; - p->next = Pipes; - Pipes = p; - } + DLIST_ADD(Pipes, p); bitmap_set(bmap, i); i += PIPE_HANDLE_OFFSET; @@ -292,13 +285,7 @@ BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn) DEBUG(4,("closed pipe name %s pnum=%x (pipes_open=%d)\n", p->name, p->pnum, pipes_open)); - if (p == Pipes) { - Pipes = p->next; - if (Pipes) Pipes->prev = NULL; - } else { - p->prev->next = p->next; - if (p->next) p->next->prev = p->prev; - } + DLIST_REMOVE(Pipes, p); memset(p, 0, sizeof(*p)); |