From: Slaven Rezic Date: Thu, 2 Oct 2003 15:51:11 +0000 (+0000) Subject: Re: 5.8.1 and srand X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a0bd7037d700e5357a2ac886eb134d5822a9ece2;p=p5sagit%2Fp5-mst-13.2.git Re: 5.8.1 and srand Message-Id: <1065109871.3115@devpc01.iconmobile.de> p4raw-id: //depot/perl@21401 --- diff --git a/t/op/fork.t b/t/op/fork.t index b3faa19..4300894 100755 --- a/t/op/fork.t +++ b/t/op/fork.t @@ -426,3 +426,21 @@ waitpid() returned ok forked second kid second child wait() returned ok +######## +pipe(RDR,WTR) or die $!; +my $pid = fork; +die "fork: $!" if !defined $pid; +if ($pid == 0) { + my $rand_child = rand; + close RDR; + print WTR $rand_child, "\n"; + close WTR; +} else { + my $rand_parent = rand; + close WTR; + chomp(my $rand_child = ); + close RDR; + print $rand_child ne $rand_parent, "\n"; +} +EXPECT +1