diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-05-24 07:34:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:08:32 -0500 |
commit | 971d30bb201f5c3faff5f575d26882eb79f7955a (patch) | |
tree | aad4df492eb9c8bf1e105c8bac65dc315b27a1cd /source4/libcli | |
parent | cdc64c448df49676c96f87d106af8de0c467651f (diff) | |
download | samba-971d30bb201f5c3faff5f575d26882eb79f7955a.tar.gz samba-971d30bb201f5c3faff5f575d26882eb79f7955a.tar.bz2 samba-971d30bb201f5c3faff5f575d26882eb79f7955a.zip |
r15854: more talloc_set_destructor() typesafe fixes
(This used to be commit 61c6100617589ac6df4f527877241464cacbf8b3)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/cldap/cldap.c | 3 | ||||
-rw-r--r-- | source4/libcli/dgram/mailslot.c | 5 | ||||
-rw-r--r-- | source4/libcli/ldap/ldap_client.c | 3 | ||||
-rw-r--r-- | source4/libcli/nbt/nbtsocket.c | 6 | ||||
-rw-r--r-- | source4/libcli/raw/clitransport.c | 7 | ||||
-rw-r--r-- | source4/libcli/resolve/host.c | 3 | ||||
-rw-r--r-- | source4/libcli/smb2/transport.c | 6 | ||||
-rw-r--r-- | source4/libcli/wrepl/winsrepl.c | 9 |
8 files changed, 13 insertions, 29 deletions
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c index 58beb1b642..03e690ef18 100644 --- a/source4/libcli/cldap/cldap.c +++ b/source4/libcli/cldap/cldap.c @@ -44,9 +44,8 @@ /* destroy a pending request */ -static int cldap_request_destructor(void *ptr) +static int cldap_request_destructor(struct cldap_request *req) { - struct cldap_request *req = talloc_get_type(ptr, struct cldap_request); if (req->state == CLDAP_REQUEST_SEND) { DLIST_REMOVE(req->cldap->send_queue, req); } diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c index 467289bcee..775f662370 100644 --- a/source4/libcli/dgram/mailslot.c +++ b/source4/libcli/dgram/mailslot.c @@ -41,11 +41,8 @@ /* destroy a mailslot handler */ -static int dgram_mailslot_destructor(void *ptr) +static int dgram_mailslot_destructor(struct dgram_mailslot_handler *dgmslot) { - struct dgram_mailslot_handler *dgmslot = - talloc_get_type(ptr, struct dgram_mailslot_handler); - DLIST_REMOVE(dgmslot->dgmsock->mailslot_handlers, dgmslot); return 0; } diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index 8d815c7103..07b7f2b412 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -487,9 +487,8 @@ static void ldap_reconnect(struct ldap_connection *conn) } /* destroy an open ldap request */ -static int ldap_request_destructor(void *ptr) +static int ldap_request_destructor(struct ldap_request *req) { - struct ldap_request *req = talloc_get_type(ptr, struct ldap_request); if (req->state == LDAP_REQUEST_PENDING) { DLIST_REMOVE(req->conn->pending, req); } diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c index 50da8168e0..7bdeb834f9 100644 --- a/source4/libcli/nbt/nbtsocket.c +++ b/source4/libcli/nbt/nbtsocket.c @@ -32,10 +32,8 @@ /* destroy a pending request */ -static int nbt_name_request_destructor(void *ptr) -{ - struct nbt_name_request *req = talloc_get_type(ptr, struct nbt_name_request); - +static int nbt_name_request_destructor(struct nbt_name_request *req) +{ if (req->state == NBT_REQUEST_SEND) { DLIST_REMOVE(req->nbtsock->send_queue, req); } diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index 2ad155e9b9..fc257b9098 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -50,10 +50,8 @@ static void smbcli_transport_event_handler(struct event_context *ev, /* destroy a transport */ -static int transport_destructor(void *ptr) +static int transport_destructor(struct smbcli_transport *transport) { - struct smbcli_transport *transport = ptr; - smbcli_transport_dead(transport); return 0; } @@ -538,9 +536,8 @@ static void smbcli_timeout_handler(struct event_context *ev, struct timed_event /* destroy a request */ -static int smbcli_request_destructor(void *ptr) +static int smbcli_request_destructor(struct smbcli_request *req) { - struct smbcli_request *req = talloc_get_type(ptr, struct smbcli_request); if (req->state == SMBCLI_REQUEST_RECV) { DLIST_REMOVE(req->transport->pending_recv, req); } diff --git a/source4/libcli/resolve/host.c b/source4/libcli/resolve/host.c index 781ea957df..18188f7c1c 100644 --- a/source4/libcli/resolve/host.c +++ b/source4/libcli/resolve/host.c @@ -51,9 +51,8 @@ struct host_state { name resolution without leaving a potentially blocking call running in a child */ -static int host_destructor(void *ptr) +static int host_destructor(struct host_state *state) { - struct host_state *state = talloc_get_type(ptr, struct host_state); close(state->child_fd); if (state->child != (pid_t)-1) { kill(state->child, SIGTERM); diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c index 6567ad4de7..9b6a39171d 100644 --- a/source4/libcli/smb2/transport.c +++ b/source4/libcli/smb2/transport.c @@ -51,9 +51,8 @@ static void smb2_transport_event_handler(struct event_context *ev, /* destroy a transport */ -static int transport_destructor(void *ptr) +static int transport_destructor(struct smb2_transport *transport) { - struct smb2_transport *transport = ptr; smb2_transport_dead(transport); return 0; } @@ -254,9 +253,8 @@ static void smb2_timeout_handler(struct event_context *ev, struct timed_event *t /* destroy a request */ -static int smb2_request_destructor(void *ptr) +static int smb2_request_destructor(struct smb2_request *req) { - struct smb2_request *req = talloc_get_type(ptr, struct smb2_request); if (req->state == SMB2_REQUEST_RECV) { DLIST_REMOVE(req->transport->pending_recv, req); } diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c index c37d5f9873..a1735c547c 100644 --- a/source4/libcli/wrepl/winsrepl.c +++ b/source4/libcli/wrepl/winsrepl.c @@ -144,9 +144,8 @@ static void wrepl_error(void *private, NTSTATUS status) /* destroy a wrepl_socket destructor */ -static int wrepl_socket_destructor(void *ptr) +static int wrepl_socket_destructor(struct wrepl_socket *sock) { - struct wrepl_socket *sock = talloc_get_type(ptr, struct wrepl_socket); if (sock->dead) { sock->free_skipped = True; return -1; @@ -244,9 +243,8 @@ failed: /* destroy a wrepl_request */ -static int wrepl_request_destructor(void *ptr) +static int wrepl_request_destructor(struct wrepl_request *req) { - struct wrepl_request *req = talloc_get_type(ptr, struct wrepl_request); if (req->state == WREPL_REQUEST_RECV) { DLIST_REMOVE(req->wrepl_socket->recv_queue, req); } @@ -431,9 +429,8 @@ struct wrepl_send_ctrl_state { struct wrepl_socket *wrepl_sock; }; -static int wrepl_send_ctrl_destructor(void *ptr) +static int wrepl_send_ctrl_destructor(struct wrepl_send_ctrl_state *s) { - struct wrepl_send_ctrl_state *s = talloc_get_type(ptr, struct wrepl_send_ctrl_state); struct wrepl_request *req = s->wrepl_sock->recv_queue; /* check if the request is still in WREPL_STATE_RECV, |