perl/32_fix_fork_rand

44 lines
1.1 KiB
Plaintext
Raw Normal View History

Stop t/op/fork.t relying on rand(). (Closes: #317843)
[perl #53238]
blead change 33749
From: David Dick <perlbug-followup@perl.org>
Date: Tue, 22 Apr 2008 21:12:42 -0700
Subject: [PATCH] [perl #53238] Patch to stop t/op/fork.t relying on rand
From: David Dick (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-23612-1208949161-1511.53238-75-0@perl.org>
p4raw-id: //depot/perl@33749
---
t/op/fork.t | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/t/op/fork.t b/t/op/fork.t
index 7318449..a19b260 100755
--- a/t/op/fork.t
+++ b/t/op/fork.t
@@ -445,16 +445,14 @@ 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";
+ print WTR "STRING_FROM_CHILD\n";
close WTR;
} else {
- my $rand_parent = rand;
close WTR;
- chomp(my $rand_child = <RDR>);
+ chomp(my $string_from_child = <RDR>);
close RDR;
- print $rand_child ne $rand_parent, "\n";
+ print $string_from_child eq "STRING_FROM_CHILD", "\n";
}
EXPECT
1
--
1.5.6.5