summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-12 12:25:42 +0200
committerVolker Lendecke <vl@samba.org>2008-07-26 13:20:10 +0200
commita803f0a9204fc917668b68ca67ff02e8f9ed0262 (patch)
tree0c1332ee30283f4966a70c26ca420274f0f45666 /source3/rpc_server
parent1ee37bc9c3d3a4aefc50efc90db42b81f51bcd03 (diff)
downloadsamba-a803f0a9204fc917668b68ca67ff02e8f9ed0262.tar.gz
samba-a803f0a9204fc917668b68ca67ff02e8f9ed0262.tar.bz2
samba-a803f0a9204fc917668b68ca67ff02e8f9ed0262.zip
Refactoring: Make close_internal_rpc_pipe_hnd a talloc destructor
(This used to be commit 10b47a0c2cfd62489428518112da82f73a52b7bc)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index aa5bd5394a..2e77b5b903 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -64,7 +64,7 @@ static struct bitmap *bmap;
static ssize_t read_from_internal_pipe(void *np_conn, char *data, size_t n,
bool *is_data_outstanding);
static ssize_t write_to_internal_pipe(void *np_conn, char *data, size_t n);
-static bool close_internal_rpc_pipe_hnd(void *np_conn);
+static int close_internal_rpc_pipe_hnd(struct pipes_struct *pipe);
/****************************************************************************
Internal Pipe iterator functions.
@@ -213,7 +213,6 @@ smb_np_struct *open_rpc_pipe_p(const char *pipe_name,
p->namedpipe_create = make_internal_rpc_pipe_p;
p->namedpipe_read = read_from_internal_pipe;
p->namedpipe_write = write_to_internal_pipe;
- p->namedpipe_close = close_internal_rpc_pipe_hnd;
p->np_state = p->namedpipe_create(pipe_name, conn->client_address,
conn->server_info, vuid);
@@ -341,6 +340,8 @@ struct pipes_struct *make_internal_rpc_pipe_p(const char *pipe_name,
DEBUG(4,("Created internal pipe %s (pipes_open=%d)\n",
pipe_name, pipes_open));
+ talloc_set_destructor(p, close_internal_rpc_pipe_hnd);
+
return p;
}
@@ -1136,7 +1137,7 @@ bool close_rpc_pipe_hnd(smb_np_struct *p)
return False;
}
- p->namedpipe_close(p->np_state);
+ TALLOC_FREE(p->np_state);
bitmap_clear(bmap, p->pnum - pipe_handle_offset);
@@ -1179,9 +1180,8 @@ void pipe_close_conn(connection_struct *conn)
Close an rpc pipe.
****************************************************************************/
-static bool close_internal_rpc_pipe_hnd(void *np_conn)
+static int close_internal_rpc_pipe_hnd(struct pipes_struct *p)
{
- pipes_struct *p = (pipes_struct *)np_conn;
if (!p) {
DEBUG(0,("Invalid pipe in close_internal_rpc_pipe_hnd\n"));
return False;