From: Paul Floyd Date: Sun, 17 Mar 2024 06:07:43 +0000 (+0100) Subject: FreeBSD regtest: change scalar so it runs OK in vgtest and a shell X-Git-Tag: VALGRIND_3_23_0~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4347d534f585eb4c6e8c1f690fd041e5119aa59f;p=thirdparty%2Fvalgrind.git FreeBSD regtest: change scalar so it runs OK in vgtest and a shell --- diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index 40479dcbb..463fee361 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -25,9 +25,9 @@ int main(void) { /* Uninitialised, but we know px[0] is 0x0. */ - /* PJF why ? */ long *px = malloc(2*sizeof(long)); x0 = px[0]; + const char* running_in_vgtest = getenv("RUNNING_IN_VGTEST"); /* SYS_syscall 0 */ /* does this need a specific test? There are two diffeent IDs for syscall, see 198 */ @@ -556,7 +556,12 @@ int main(void) /* SYS_setsid 147 */ GO(SYS_setsid, "0s 0m"); - SY(SYS_setsid); SUCC; /* FAIL when run standalone */ + SY(SYS_setsid); + if (running_in_vgtest) { + SUCC; + } else { + FAIL; + } /* SYS_quotactl 148 */ GO(SYS_quotactl, "(Q_QUOTAOFF) 2s 0m"); diff --git a/memcheck/tests/freebsd/scalar.vgtest b/memcheck/tests/freebsd/scalar.vgtest index 28f279ceb..170c1576e 100644 --- a/memcheck/tests/freebsd/scalar.vgtest +++ b/memcheck/tests/freebsd/scalar.vgtest @@ -8,4 +8,7 @@ stderr_filter: filter_scalar # 'syscall (in libc)' stack frame and this is then filtered out completely. stderr_filter_args: libc args: < scalar.c - +# this is for 'setsid', when run by vg_regtest the process isn't +# process group leader and succeeds +# but when run from a shell the process is group leader and it fails +env: RUNNING_IN_VGTEST=1