This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] v2 BZ# 18125: setcontext: Call exit, not _exit, after last linked context executes.


On 16 Mar 2015 19:14, Carlos O'Donell wrote:
>	* Makefile (tests): Add tst-setcontext3.

your ChangeLog says Makefile, but the patch doesn't contain it ...

> --- /dev/null
> +++ b/stdlib/tst-setcontext3.c
>
> +char *filename;

could be static right ?

> +static int
> +do_test (int argc, char **argv)
> +{
> +  int ret;
> +  char st1[32768];
> +  ucontext_t tempctx = ctx;
> +
> +  if (argc < 2)
> +    {
> +      printf ("FAIL: Test missing filename argument.\n");
> +      exit (1);

it's not wrong, just weird, but this func uses exit half the time and return the 
other half ...

> --- /dev/null
> +++ b/stdlib/tst-setcontext3.sh
>
> +cleanup() {
> +    rm -f "${tempfiles[@]}"
> +}

stylewise, seems like we normally use two space indent ?

> +# We want to run the test program and see if secontext called
> +# exit() and wrote out the test file we specified.  If the
> +# test exits with a non-zero status this will fail because we
> +# are using `set -e`.
> +$test_pre $test "$tempfile"

what about 77 ?  the test_pre part really only ever expands into `env VAR=val` 
right ?  so i think you need to explicitly capture & test the exit value in 
order to handle 77 correctly.
-mike

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]