summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/otl.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-03 20:11:39 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-03 20:11:39 +0000
commit7f243ae21ae07f94efc11fbf943b46ddafe460c0 (patch)
tree8e197e659909c7bfe89096efff792fc255e15ce5 /IkiWiki/Plugin/otl.pm
parent9b4d117eb1fbdc9112147c52d7bb77aab9ef6bdb (diff)
* Add proper waitpid calls for open2ed processes throughout to avoid
zombies; this hit htmltidy especially badly.
Diffstat (limited to 'IkiWiki/Plugin/otl.pm')
-rw-r--r--IkiWiki/Plugin/otl.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/otl.pm b/IkiWiki/Plugin/otl.pm
index be339c88e..0cd93a3ec 100644
--- a/IkiWiki/Plugin/otl.pm
+++ b/IkiWiki/Plugin/otl.pm
@@ -31,9 +31,10 @@ sub htmlize (@) { #{{{
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--;
@@ -51,6 +52,9 @@ sub htmlize (@) { #{{{
local $/ = undef;
my $ret=<IN>;
+ close IN;
+ waitpid $pid, 0;
+
$ret=~s/.*<body>//s;
$ret=~s/<body>.*//s;
$ret=~s/<div class="Footer">.*//s;