Nicholas Nethercote 0eb6b6654a Changed test so the output doesn't depend on the order in which the parent and
child run;  this was random so the test was failing spuriously sometimes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1123
2002-09-27 10:38:20 +00:00

21 lines
414 B
C

#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
int main(void)
{
pid_t pid;
pid = fork ();
/* Sometimes child goes first (non-zero), sometimes parent (zero). This
printing means we can detect if we correctly get a zero result and a
non-zero result (--> three 'X's printed), but the output doesn't depend
on the order. */
printf("%s", pid==0 ? "X" : "XX");
return 0;
}