forked from interchange/interchange
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hints.pl
64 lines (56 loc) · 1.27 KB
/
hints.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/perl
package mvhints;
sub get_hints {
my @out;
my $condition;
my $routine;
$condition = sub { $^O =~ /nolongernecessary/i };
$routine = sub {
my $fn = 'interchange.cfg.dist';
rename $fn, "$fn.bak";
open HINTIN, "$fn.bak"
or die "cannot open $fn.bak: $!\n";
open HINTOUT, ">$fn"
or die "cannot write $fn: $!\n";
while(<HINTIN>) {
s/
^\s*Housekeeping\s+\d+.*$
/# Changed for $^O, no safe signals\nHousekeeping 1/xig;
s/
^\s*MaxServers\s+\d+.*$
/# Changed for $^O, no safe signals\nMaxServers 0/xig;
print HINTOUT $_;
}
close HINTIN;
close HINTOUT;
unlink "$fn.bak";
return 1;
};
push @out, [ $condition, $routine ];
$condition = sub { $Global::TryingThreads && $^O =~ /linux/i };
$routine = sub {
my $fn = 'interchange.cfg.dist';
rename $fn, "$fn.bak";
open HINTIN, "$fn.bak"
or die "cannot open $fn.bak: $!\n";
open HINTOUT, ">$fn"
or die "cannot write $fn: $!\n";
while(<HINTIN>) {
print HINTOUT $_;
}
if ($^V lt 5.10.0) {
print HINTOUT <<EOF;
## Added because threaded Perl on linux has broken getppid() as
## of this distribution
Variable MV_GETPPID_BROKEN 1
EOF
close HINTIN;
close HINTOUT;
unlink "$fn.bak";
return 1;
}
};
push @out, [ $condition, $routine ];
return @out;
}
1;