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 | a77658a33f84c2961fe92bec7576fb581e3c7ad6 (patch) | |
tree | d2fa73cbaba29d18694db332ce1183fd02a8d8d0 /source3/lib/tallocmsg.c | |
parent | e789a870f185227f44f950261d54b1d02e6f5a8f (diff) | |
download | samba-a77658a33f84c2961fe92bec7576fb581e3c7ad6.tar.gz samba-a77658a33f84c2961fe92bec7576fb581e3c7ad6.tar.bz2 samba-a77658a33f84c2961fe92bec7576fb581e3c7ad6.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.
(This used to be commit 2e262a75cca4575edd00db3d24e7e35760943120)
Diffstat (limited to 'source3/lib/tallocmsg.c')
-rw-r--r-- | source3/lib/tallocmsg.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/lib/tallocmsg.c b/source3/lib/tallocmsg.c index 8f03fd66ff..b515093cd6 100644 --- a/source3/lib/tallocmsg.c +++ b/source3/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); } /** |