diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-11-12 16:57:17 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-11-12 16:57:17 +0000 |
commit | 8899fb784ab641a6c2aa755a3141718cd0e6f4af (patch) | |
tree | 6a97556066459bcfbaf4a9740de52ad0d026e020 /debug/tst-chk1.c | |
parent | 8ae4ba1c6d925bdd110d6bbc04f6338065dd56ac (diff) |
* debug/chk_fail.c: Include errno.h and string.h.
(__chk_fail): Write a short message to stderr.
* debug/tst-chk1.c: Include fcntl.h.
(do_test): Redirect stderr to /dev/null.
* debug/test-strcpy_chk.c: Include fcntl.h.
(test_main): Redirect stderr to /dev/null.
(do_one_test, do_random_tests): Use printf instead of
error.
Diffstat (limited to 'debug/tst-chk1.c')
-rw-r--r-- | debug/tst-chk1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c index 9c9f82a3af..e01284ae53 100644 --- a/debug/tst-chk1.c +++ b/debug/tst-chk1.c @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <fcntl.h> #include <setjmp.h> #include <signal.h> #include <stdio.h> @@ -106,6 +107,10 @@ do_test (void) sigaction (SIGABRT, &sa, NULL); + /* Avoid all the buffer overflow messages on stderr. */ + close (STDERR_FILENO); + open ("/dev/null", O_WRONLY); + struct A { char buf1[9]; char buf2[1]; } a; printf ("Test checking routines at fortify level %d\n", |