From: Tom Hughes Date: Mon, 15 Nov 2004 15:35:49 +0000 (+0000) Subject: After a clone system call there are two threads of control running so we X-Git-Tag: svn/VALGRIND_3_0_0~1305 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de135bbb7fa56edb0365bba88679d56e4c2dd5d1;p=thirdparty%2Fvalgrind.git After a clone system call there are two threads of control running so we need to make sure the child exits or we will get two copies of the output from each test which follows. Also some older systems do not define the CLONE_PARENT_SETTID flag. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3007 --- diff --git a/memcheck/tests/scalar.c b/memcheck/tests/scalar.c index dd369c3d7e..09ec13087d 100644 --- a/memcheck/tests/scalar.c +++ b/memcheck/tests/scalar.c @@ -507,9 +507,15 @@ int main(void) // __NR_clone 120 #include #include +#ifndef CLONE_PARENT_SETTID +#define CLONE_PARENT_SETTID 0x00100000 +#endif // XXX: should really be "4s 2m"? Not sure... (see PRE(sys_clone)) GO(__NR_clone, "4s 0m"); - SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0); + if (SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0) == 0) + { + SY(__NR_exit, 0); + } // __NR_setdomainname 121 GO(__NR_setdomainname, "n/a");