scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 0714d6c83087281c17643f2c48ab1568f95f8320
parent d23376cb646303034a20b4f442c9320e4ebe4f1d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  1 Oct 2021 21:30:26 +0200

tests/libc: Fix 0002-assert test

After adding the output of stderr to the comparision file
we have to consider it for the diff, and for this reason
we have to add it to the expected output.

Diffstat:
Msrc/libc/arch/linux/_sigaction.c | 18+++---------------
Mtests/libc/execute/0002-assert.c | 1+
2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/src/libc/arch/linux/_sigaction.c b/src/libc/arch/linux/_sigaction.c @@ -7,30 +7,18 @@ extern void _sigreturn(void); int _sigaction(int sig, struct sigaction *sa, struct sigaction *old) { - int r; - struct sigaction ksa, kold; + struct sigaction ksa, *p = NULL; if (sa) { ksa.sa_handler = sa->sa_handler; ksa.sa_flags = sa->sa_flags | SA_RESTORER; ksa.sa_restorer = _sigreturn; memcpy(&ksa.sa_mask, &sa->sa_mask, sizeof(ksa.sa_mask)); + p = &ksa; } - r = __sigaction(sig, - sa ? &ksa : NULL, - old ? &kold : NULL, - sizeof(ksa.sa_mask)); - - if (r != 0) + if (__sigaction(sig, p, old, sizeof(ksa.sa_mask)) < 0) return -1; - - if (old) { - old->sa_handler = kold.sa_handler; - old->sa_flags = kold.sa_flags; - memcpy(&old->sa_mask, &kold.sa_mask, sizeof kold.sa_mask); - } - return 0; } diff --git a/tests/libc/execute/0002-assert.c b/tests/libc/execute/0002-assert.c @@ -7,6 +7,7 @@ output: First assert Second assert, that must fail +0002-assert.c:32: assertion failed 'sizeof(i) < sizeof(c)' end: */