aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-06-22 14:19:14 -0700
committerMike Frysinger <vapier@gentoo.org>2012-06-23 18:02:43 -0400
commit40abb498ca4a24495fe34e133379382ce8c3eaca (patch)
treea8779b17558a4c96eb2d5c56e82cee4743d408aa /libsandbox/memory.c
parentuse m4_flatten to make multiline lists easier to handle (diff)
downloadsandbox-40abb498ca4a24495fe34e133379382ce8c3eaca.tar.gz
sandbox-40abb498ca4a24495fe34e133379382ce8c3eaca.tar.bz2
sandbox-40abb498ca4a24495fe34e133379382ce8c3eaca.zip
significantly overhaul output helpers
There are a few major points we want to hit here: - have all output from libsandbox go through portage helpers when we are in the portage environment so that output is properly logged - convert SB_E{info,warn,error} to sb_e{info,warn,error} to match style of other functions and cut down on confusion - move all abort/output helpers to libsbutil so it can be used in all source trees and not just by libsandbox - migrate all abort points to the centralized sb_ebort helper Unfortunately, it's not terribly easy to untangle these into separate patches, but hopefully this shouldn't be too messy as much of it is mechanical: move funcs between files, and change the name of funcs that get called. URL: http://bugs.gentoo.org/278761 Reported-by: Mounir Lamouri <volkmar@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox/memory.c')
-rw-r--r--libsandbox/memory.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libsandbox/memory.c b/libsandbox/memory.c
index bc0400f..5609208 100644
--- a/libsandbox/memory.c
+++ b/libsandbox/memory.c
@@ -54,11 +54,9 @@ void free(void *ptr)
{
if (ptr == NULL)
return;
- if (munmap(SB_MALLOC_TO_MMAP(ptr), SB_MALLOC_TO_SIZE(ptr))) {
- SB_EERROR("sandbox memory corruption", " free(%p): %s\n",
+ if (munmap(SB_MALLOC_TO_MMAP(ptr), SB_MALLOC_TO_SIZE(ptr)))
+ sb_ebort("sandbox memory corruption with free(%p): %s\n",
ptr, strerror(errno));
- sb_dump_backtrace();
- }
}
/* Hrm, implement a zalloc() ? */