summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-11-04 17:32:14 -0500
committerSimo Sorce <idra@samba.org>2008-11-04 17:39:27 -0500
commit603f59bcb502c48eb577bc6fd3232a6944756983 (patch)
treec69026d8a2be6fc3c5a871e146a69cc6ea91833c /server
parent4f49323af05f718d21b61f9763d73280430beaf2 (diff)
downloadsssd-603f59bcb502c48eb577bc6fd3232a6944756983.tar.gz
sssd-603f59bcb502c48eb577bc6fd3232a6944756983.tar.xz
sssd-603f59bcb502c48eb577bc6fd3232a6944756983.zip
Rename function, do not use other libraries namespace
Diffstat (limited to 'server')
-rw-r--r--server/util/memory.c19
-rw-r--r--server/util/util.h6
2 files changed, 16 insertions, 9 deletions
diff --git a/server/util/memory.c b/server/util/memory.c
index cf6532607..a25aa7872 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 1613c9efe..bb5526e48 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__ */