This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/3] tst-longjmp_chk: add comments and convert to test-skeleton
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 2 Jan 2014 20:51:49 +0100
- Subject: Re: [PATCH 1/3] tst-longjmp_chk: add comments and convert to test-skeleton
- Authentication-results: sourceware.org; auth=none
- References: <1388359563-12505-1-git-send-email-vapier at gentoo dot org>
On Sun, Dec 29, 2013 at 06:26:01PM -0500, Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> 2013-12-29 Mike Frysinger <vapier@gentoo.org>
>
> * debug/tst-longjmp_chk.c: Add header comment and include
> ../test-skeleton.c.
> (do_test): Mark static.
> (TEST_FUNCTION): Define.
> ---
> debug/tst-longjmp_chk.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/debug/tst-longjmp_chk.c b/debug/tst-longjmp_chk.c
> index 8892974..dba1855 100644
> --- a/debug/tst-longjmp_chk.c
> +++ b/debug/tst-longjmp_chk.c
> @@ -1,3 +1,5 @@
> +/* Basic test to make sure doing a longjmp to a jmpbuf with an invalid sp
> + is caught by the fortification code. */
> #include <errno.h>
> #include <fcntl.h>
> #include <paths.h>
> @@ -43,8 +45,8 @@ handler (int sig)
> }
>
>
> -int
> -main (void)
> +static int
> +do_test (void)
> {
> struct sigaction sa;
> sa.sa_handler = handler;
> @@ -84,3 +86,6 @@ main (void)
> puts ("second longjmp returned");
> return 1;
> }
> +
> +#define TEST_FUNCTION do_test ()
> +#include "../test-skeleton.c"
> --
> 1.8.4.3
ok after freeze.