From ee07221f578576aef376c97e3dc9615e8438658f Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Sat, 19 Nov 2005 15:19:03 +0000 Subject: [PATCH] Make the syslog message string static const, saves the copy. Noticed by Valeriy E. Ushakov. Include some more headers, use __unused in the function declaration, not in the protorype. This fixes most warnings. --- lib/libc/sys/stack_protector.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/sys/stack_protector.c index 665dd25f51..4f19acbfcc 100644 --- a/lib/libc/sys/stack_protector.c +++ b/lib/libc/sys/stack_protector.c @@ -24,16 +24,20 @@ * POSSIBILITY OF SUCH DAMAGE. * * $OpenBSD: stack_protector.c,v 1.3 2002/12/10 08:53:42 etoh Exp $ - * $DragonFly: src/lib/libc/sys/stack_protector.c,v 1.2 2005/01/31 22:29:46 dillon Exp $ + * $DragonFly: src/lib/libc/sys/stack_protector.c,v 1.3 2005/11/19 15:19:03 joerg Exp $ */ #include "namespace.h" #include #include +#include +#include +#include #include +#include #include "un-namespace.h" -void __stack_smash_handler(char func[], int damaged __attribute__((unused))); +void __stack_smash_handler(char func[], int damaged); static void __guard_setup(void) __attribute__ ((constructor)); long __guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; @@ -64,9 +68,9 @@ __guard_setup(void) } void -__stack_smash_handler(char func[], int damaged) +__stack_smash_handler(char func[], int damaged __unused) { - const char message[] = "stack overflow in function %s"; + static const char message[] = "stack overflow in function %s"; struct sigaction sa; /* this may fail on a chroot jail, though luck */ -- 2.41.0