From 3255daa1888c7d2f10e929b1d0614db4a0a013e7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 19 Apr 2007 09:08:53 +0000 Subject: r22366: sync lib/talloc/ with samba4 metze (This used to be commit 7fab12b34a818f029f4285a59d6e49768b7f8e79) --- source3/lib/talloc/config.mk | 5 ----- source3/lib/talloc/talloc.h | 4 ++++ source3/lib/talloc/talloc.pc.in | 5 +++-- source3/lib/talloc/testsuite.c | 16 +++++++++++++++- 4 files changed, 22 insertions(+), 8 deletions(-) (limited to 'source3/lib/talloc') diff --git a/source3/lib/talloc/config.mk b/source3/lib/talloc/config.mk index 0b06687dab..714ad72d1c 100644 --- a/source3/lib/talloc/config.mk +++ b/source3/lib/talloc/config.mk @@ -11,8 +11,3 @@ DESCRIPTION = A hierarchical pool based memory system with destructors # # End LIBRARY LIBTALLOC ################################################ - -[BINARY::TALLOC] -OBJ_FILES = testsuite.o -PRIVATE_DEPENDENCIES = LIBTALLOC -INSTALLDIR = TORTUREDIR/LOCAL diff --git a/source3/lib/talloc/talloc.h b/source3/lib/talloc/talloc.h index 51640bb28d..195c6c25b6 100644 --- a/source3/lib/talloc/talloc.h +++ b/source3/lib/talloc/talloc.h @@ -26,6 +26,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include +#include + /* this is only needed for compatibility with the old talloc */ typedef void TALLOC_CTX; diff --git a/source3/lib/talloc/talloc.pc.in b/source3/lib/talloc/talloc.pc.in index 7f9ef754cb..f93036a33d 100644 --- a/source3/lib/talloc/talloc.pc.in +++ b/source3/lib/talloc/talloc.pc.in @@ -6,5 +6,6 @@ includedir=@includedir@ Name: talloc Description: A hierarchical pool based memory system with destructors Version: 4.0 -Libs: @LIBS@ -L${libdir} -ltalloc -Cflags: -I${includedir} @CFLAGS@ +Libs: -L${libdir} -ltalloc +Cflags: -I${includedir} +URL: http://talloc.samba.org/ diff --git a/source3/lib/talloc/testsuite.c b/source3/lib/talloc/testsuite.c index f51252e57b..d122a5de0d 100644 --- a/source3/lib/talloc/testsuite.c +++ b/source3/lib/talloc/testsuite.c @@ -1012,6 +1012,8 @@ static bool test_talloc_ptrtype(void) static bool test_autofree(void) { +#if _SAMBA_BUILD_ < 4 + /* autofree test would kill smbtorture */ void *p; printf("test: autofree [\nTALLOC AUTOFREE CONTEXT\n]\n"); @@ -1022,13 +1024,17 @@ static bool test_autofree(void) talloc_free(p); printf("success: autofree\n"); +#endif return true; } -int main(void) +struct torture_context; +bool torture_local_talloc(struct torture_context *tctx) { bool ret = true; + setlinebuf(stdout); + talloc_disable_null_tracking(); talloc_enable_null_tracking(); @@ -1055,7 +1061,15 @@ int main(void) } ret &= test_autofree(); + return ret; +} + +#if _SAMBA_BUILD_ < 4 +int main(void) +{ + bool ret = torture_local_talloc(NULL); if (!ret) return -1; return 0; } +#endif -- cgit