diff options
author | Jeremy Allison <jra@samba.org> | 2005-11-29 23:01:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:40 -0500 |
commit | 2e262a75cca4575edd00db3d24e7e35760943120 (patch) | |
tree | e08c153128c33de306d511dd8e9e4962251d7e7d /source/lib/tallocmsg.c | |
parent | abf761c8bf5e8cd3b0aba66abd5fd896035ea1ac (diff) | |
download | samba-2e262a75cca4575edd00db3d24e7e35760943120.tar.gz samba-2e262a75cca4575edd00db3d24e7e35760943120.tar.xz samba-2e262a75cca4575edd00db3d24e7e35760943120.zip |
r11962: Bring talloc up to date with Samba4, re-add the
talloc_describe_all() function. Fix smbcontrol <pid> pool-usage
as we desparately need it working in the field to track down
memory leaks. Seriously, when new functionality like the
Samba4 talloc is added, don't just disable working functionality
like "pool-usage", fix the damn thing first !
Jeremy.
Diffstat (limited to 'source/lib/tallocmsg.c')
-rw-r--r-- | source/lib/tallocmsg.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/lib/tallocmsg.c b/source/lib/tallocmsg.c index 8f03fd66ff1..b515093cd69 100644 --- a/source/lib/tallocmsg.c +++ b/source/lib/tallocmsg.c @@ -33,18 +33,23 @@ void msg_pool_usage(int msg_type, struct process_id src_pid, void *UNUSED(buf), size_t UNUSED(len)) { - off_t reply; - fstring reply_str; + char *reply = NULL; SMB_ASSERT(msg_type == MSG_REQ_POOL_USAGE); DEBUG(2,("Got POOL_USAGE\n")); - reply = talloc_total_size(NULL); - fstr_sprintf(reply_str, "%ld", (long)reply); + reply = talloc_describe_all(); + if (!reply) { + return; + } + become_root(); message_send_pid(src_pid, MSG_POOL_USAGE, - reply_str, strlen(reply_str)+1, True); + reply, strlen(reply)+1, True); + unbecome_root(); + + SAFE_FREE(reply); } /** |