]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD regtest: change scalar so it runs OK in vgtest and a shell
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 17 Mar 2024 06:07:43 +0000 (07:07 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 17 Mar 2024 06:07:43 +0000 (07:07 +0100)
memcheck/tests/freebsd/scalar.c
memcheck/tests/freebsd/scalar.vgtest

index 40479dcbb916e851823b7c6b2e436c0f7db3ce73..463fee36176416cdbe207957f5f45c311cbcb36e 100644 (file)
@@ -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");
index 28f279ceba9169001694084c48bf42778ab0d3cd..170c1576e1446bce65be183760884b1e443a4df4 100644 (file)
@@ -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