zombies; this hit htmltidy especially badly.
my %params=@_;
my $tries=10;
+ my $pid;
while (1) {
eval {
- open2(*IN, *OUT, 'tidy -quiet -asxhtml -utf8 --show-body-only yes --show-warnings no --tidy-mark no');
+ $pid=open2(*IN, *OUT, 'tidy -quiet -asxhtml -utf8 --show-body-only yes --show-warnings no --tidy-mark no');
};
last unless $@;
$tries--;
close OUT;
local $/ = undef;
- return <IN>;
+ my $ret=<IN>;
+ close IN;
+ waitpid $pid, 0;
+
+ return $ret;
} # }}}
1
my %params=@_;
my $tries=10;
+ my $pid;
while (1) {
eval {
- open2(*IN, *OUT, 'otl2html -S /dev/null -T /dev/stdin');
+ $pid=open2(*IN, *OUT, 'otl2html -S /dev/null -T /dev/stdin');
};
last unless $@;
$tries--;
local $/ = undef;
my $ret=<IN>;
+ close IN;
+ waitpid $pid, 0;
+
$ret=~s/.*<body>//s;
$ret=~s/<body>.*//s;
$ret=~s/<div class="Footer">.*//s;
my $content=$params{content};
my $tries=10;
+ my $pid;
while (1) {
eval {
# Try to call python and run our command
- open2(*IN, *OUT, "python", "-c", $pyCmnd)
+ $pid=open2(*IN, *OUT, "python", "-c", $pyCmnd)
or return $content;
};
last unless $@;
print OUT $content;
close OUT;
+
local $/ = undef;
- return <IN>;
+ my $ret=<IN>;
+ close IN;
+ waitpid $pid, 0;
+
+ return $ret;
} # }}}
1
+ikiwiki (1.25) UNRELEASED; urgency=low
+
+ * Add proper waitpid calls for open2ed processes throughout to avoid
+ zombies; this hit htmltidy especially badly.
+
+ -- Joey Hess <joeyh@debian.org> Sun, 3 Sep 2006 15:56:55 -0400
+
ikiwiki (1.24) unstable; urgency=low
* Simplify the data structure returned by rcs_recentchanges to avoid