From 58b69898e9adecefe85c1a421d287a800d974f1b Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 10 Jul 2017 14:14:27 -0700
Subject: [PATCH 2/2] Replace int with bool in __fortify_fail_abort
* debug/fortify_fail.c (__fortify_fail_abort): Replace int with
bool.
(__fortify_fail): Pass false to __fortify_fail_abort.
* debug/stack_chk_fail.c (__stack_chk_fail): Pass true to
__fortify_fail_abort.
* include/stdio.h: Include <stdbool.h>l
(__fortify_fail_abort): Replace int with bool.
---
debug/fortify_fail.c | 4 ++--
debug/stack_chk_fail.c | 2 +-
include/stdio.h | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)
@@ -23,7 +23,7 @@ extern char **__libc_argv attribute_hidden;
void
__attribute__ ((noreturn)) internal_function
-__fortify_fail_abort (int no_backtrace, const char *msg)
+__fortify_fail_abort (bool no_backtrace, const char *msg)
{
/* The loop is added only to keep gcc happy. */
while (1)
@@ -35,7 +35,7 @@ void
__attribute__ ((noreturn)) internal_function
__fortify_fail (const char *msg)
{
- __fortify_fail_abort (0, msg);
+ __fortify_fail_abort (false, msg);
}
libc_hidden_def (__fortify_fail)
@@ -25,7 +25,7 @@ void
__attribute__ ((noreturn))
__stack_chk_fail (void)
{
- __fortify_fail_abort (1, "stack smashing detected");
+ __fortify_fail_abort (true, "stack smashing detected");
}
#ifdef SHARED
@@ -1,5 +1,6 @@
#ifndef _STDIO_H
# include <libio/stdio.h>
+# include <stdbool.h>
# ifndef _ISOMAC
/* Now define the internal interfaces. */
@@ -92,7 +93,7 @@ extern void __libc_fatal (const char *__message)
extern void __libc_message (int do_abort, const char *__fnt, ...);
extern void __fortify_fail (const char *msg)
__attribute__ ((__noreturn__)) internal_function;
-extern void __fortify_fail_abort (int, const char *msg)
+extern void __fortify_fail_abort (bool, const char *msg)
__attribute__ ((__noreturn__)) internal_function;
libc_hidden_proto (__fortify_fail)
libc_hidden_proto (__fortify_fail_abort)
--
2.9.4