summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlaven Rezic <slaven@rezic.de>2003-10-02 15:51:11 +0000
committerAbhijit Menon-Sen <ams@wiw.org>2003-10-02 17:25:34 +0000
commita0bd7037d700e5357a2ac886eb134d5822a9ece2 (patch)
tree4425bec72d9551d001a9f343a7edbfc60a951b91
parenta2e0df50c978d4232432f27fc75a5d0391864771 (diff)
downloadperl-a0bd7037d700e5357a2ac886eb134d5822a9ece2.tar.gz
Re: 5.8.1 and srand
Message-Id: <1065109871.3115@devpc01.iconmobile.de> p4raw-id: //depot/perl@21401
-rwxr-xr-xt/op/fork.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/op/fork.t b/t/op/fork.t
index b3faa19aa7..4300894b5c 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 = <RDR>);
+ close RDR;
+ print $rand_child ne $rand_parent, "\n";
+}
+EXPECT
+1