From 62aadce2eeedb461c07f12ead92e6f8de97cedd0 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Thu, 31 Jul 2014 14:29:58 +1000 Subject: Use PR_EMERG priority in assert() codepath Moving assert_fail() out of libc and into core/utils.c so that we can sanely call prlog(PR_EMERG). We shorten it from three fputs calls down to one prlog() call. This may increase the number of cycles and stack usage for when we hit an assert, which may not be desirable. Signed-off-by: Stewart Smith Signed-off-by: Benjamin Herrenschmidt --- libc/stdlib/Makefile.inc | 2 +- libc/stdlib/abort.c | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 libc/stdlib/abort.c (limited to 'libc/stdlib') diff --git a/libc/stdlib/Makefile.inc b/libc/stdlib/Makefile.inc index 473cbfcc..6d1123e0 100644 --- a/libc/stdlib/Makefile.inc +++ b/libc/stdlib/Makefile.inc @@ -13,7 +13,7 @@ SUBDIRS += $(LIBCDIR)/stdlib STDLIB_OBJS = error.o atoi.o atol.o strtol.o strtoul.o \ - rand.o abort.o + rand.o STDLIB = $(LIBCDIR)/stdlib/built-in.o $(STDLIB): $(STDLIB_OBJS:%=$(LIBCDIR)/stdlib/%) diff --git a/libc/stdlib/abort.c b/libc/stdlib/abort.c deleted file mode 100644 index 9c5ea471..00000000 --- a/libc/stdlib/abort.c +++ /dev/null @@ -1,23 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2004, 2008, 2012 IBM Corporation - * All rights reserved. - * This program and the accompanying materials - * are made available under the terms of the BSD License - * which accompanies this distribution, and is available at - * http://www.opensource.org/licenses/bsd-license.php - * - * Contributors: - * IBM Corporation - initial implementation - *****************************************************************************/ - -#include -#include -#include - -void assert_fail(const char *msg) -{ - fputs("Assert fail:", stderr); - fputs(msg, stderr); - fputs("\n", stderr); - abort(); -} -- cgit v1.2.3