diff options
author | Simo Sorce <idra@samba.org> | 2008-11-04 17:32:14 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-11-04 17:39:27 -0500 |
commit | 603f59bcb502c48eb577bc6fd3232a6944756983 (patch) | |
tree | c69026d8a2be6fc3c5a871e146a69cc6ea91833c /server/util | |
parent | 4f49323af05f718d21b61f9763d73280430beaf2 (diff) | |
download | sssd-603f59bcb502c48eb577bc6fd3232a6944756983.tar.gz sssd-603f59bcb502c48eb577bc6fd3232a6944756983.tar.bz2 sssd-603f59bcb502c48eb577bc6fd3232a6944756983.zip |
Rename function, do not use other libraries namespace
Diffstat (limited to 'server/util')
-rw-r--r-- | server/util/memory.c | 19 | ||||
-rw-r--r-- | server/util/util.h | 6 |
2 files changed, 16 insertions, 9 deletions
diff --git a/server/util/memory.c b/server/util/memory.c index cf653260..a25aa787 100644 --- a/server/util/memory.c +++ b/server/util/memory.c @@ -1,26 +1,31 @@ -#include "util/util.h" +#include "replace.h" +#include "talloc.h" /* - * talloc_takeover + * sssd_mem_takeover * This function will take a non-talloc pointer and add it to a talloc * memory context. It will accept a destructor for the original pointer * so that when the parent memory context is freed, the non-talloc * pointer will also be freed properly. */ -TALLOC_CTX *talloc_takeover(TALLOC_CTX *mem_ctx, void *ptr, int (*destructor)(void **)) { - void **handle; +TALLOC_CTX *sssd_mem_takeover(TALLOC_CTX *mem_ctx, + void *ptr, + int (*destructor)(void **)) +{ + TALLOC_CTX **handle; if (ptr == NULL) { return NULL; } - handle = talloc_named_const(mem_ctx, sizeof(void *), "void *"); + handle = talloc_named_const(mem_ctx, sizeof(void *), + "sssd_mem_takeover destructor handle"); if (handle == NULL) { return NULL; } *handle = ptr; - talloc_set_destructor(handle,destructor); + talloc_set_destructor(handle, destructor); return handle; -}
\ No newline at end of file +} diff --git a/server/util/util.h b/server/util/util.h index 1613c9ef..bb5526e4 100644 --- a/server/util/util.h +++ b/server/util/util.h @@ -44,6 +44,8 @@ void CatchChild(void); void CatchChildLeaveStatus(void); /* from memory.c */ -//TALLOC_CTX *talloc_takeover(TALLOC_CTX *mem_ctx, void *ptr, int (*destructor)(void *), const char *type); -TALLOC_CTX *talloc_takeover(TALLOC_CTX *mem_ctx, void *ptr, int (*destructor)(void **)); +TALLOC_CTX *sssd_mem_takeover(TALLOC_CTX *mem_ctx, + void *ptr, + int (*destructor)(void **)); + #endif /* __SSSD_UTIL_H__ */ |