summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-07-10 14:14:27 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-07-10 14:14:27 -0700
commit58b69898e9adecefe85c1a421d287a800d974f1b (patch)
tree7569b87252d94d8596e517ae19bd72155cb6c153
parent37900e7dee18a446afda1b9e9831cd3d331f2a4f (diff)
downloadglibc-hjl/pr12189.tar.gz
Replace int with bool in __fortify_fail_aborthjl/pr12189
* 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.
-rw-r--r--debug/fortify_fail.c4
-rw-r--r--debug/stack_chk_fail.c2
-rw-r--r--include/stdio.h3
3 files changed, 5 insertions, 4 deletions
diff --git a/debug/fortify_fail.c b/debug/fortify_fail.c
index 13063bfad8..cbd0bc2dae 100644
--- a/debug/fortify_fail.c
+++ b/debug/fortify_fail.c
@@ -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)
diff --git a/debug/stack_chk_fail.c b/debug/stack_chk_fail.c
index 2f39e43932..5ecb7bcc0e 100644
--- a/debug/stack_chk_fail.c
+++ b/debug/stack_chk_fail.c
@@ -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
diff --git a/include/stdio.h b/include/stdio.h
index 31dc7a6aea..7467b82d1c 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -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)