stas 2004/01/05 15:40:53
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
Log:
make sure that we don't close the DATA fh, so we can run configure more
than once during the same execution
Revision Changes Path
1.192 +7 -1
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -u -r1.191 -r1.192
--- TestConfig.pm 3 Jan 2004 01:43:24 -0000 1.191
+++ TestConfig.pm 5 Jan 2004 23:40:53 -0000 1.192
@@ -1094,6 +1094,9 @@
}
}
+# various dup bugs in older perl and perlio in perl < 5.8.4 need a
+# workaround to explicitly rewind the dupped DATA fh before using it
+my $DATA_pos = tell DATA;
sub httpd_conf_template {
my($self, $try) = @_;
@@ -1102,7 +1105,10 @@
return $in;
}
else {
- return \*DATA;
+ my $dup = Symbol::gensym();
+ open $dup, "<&DATA" or die "Can't dup DATA: $!";
+ seek $dup, $DATA_pos, 0; # rewind to the beginning
+ return $dup; # so we don't close DATA
}
}