[PATCH] posix: Fix system error return value [BZ #25715]

Andreas Schwab schwab@linux-m68k.org
Mon Mar 23 19:12:08 GMT 2020


On Mär 23 2020, Adhemerval Zanella via Libc-alpha wrote:

> +  if (args->term_sig == 0)
> +    {
> +      /* Expect regular termination.  */
> +      TEST_COMPARE (WIFEXITED (ret), 1);
> +      TEST_COMPARE (WEXITSTATUS (ret), args->exit_status);
> +    }
> +  else
> +    {
> +      /* status_or_signal < 0.  Expect termination by signal.  */
> +      TEST_COMPARE (WIFSIGNALED (ret), 1);
> +      TEST_COMPARE (WTERMSIG (ret), args->term_sig);

There is no requirement that WIF* return pure boolean values.  This
should check for != 0, not == 1.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Libc-alpha mailing list