diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-09-03 20:11:39 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-09-03 20:11:39 +0000 |
commit | 7f243ae21ae07f94efc11fbf943b46ddafe460c0 (patch) | |
tree | 8e197e659909c7bfe89096efff792fc255e15ce5 /IkiWiki/Plugin/htmltidy.pm | |
parent | 9b4d117eb1fbdc9112147c52d7bb77aab9ef6bdb (diff) | |
download | ikiwiki-7f243ae21ae07f94efc11fbf943b46ddafe460c0.tar ikiwiki-7f243ae21ae07f94efc11fbf943b46ddafe460c0.tar.gz |
* Add proper waitpid calls for open2ed processes throughout to avoid
zombies; this hit htmltidy especially badly.
Diffstat (limited to 'IkiWiki/Plugin/htmltidy.pm')
-rw-r--r-- | IkiWiki/Plugin/htmltidy.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/htmltidy.pm b/IkiWiki/Plugin/htmltidy.pm index 079da7b49..c626250cb 100644 --- a/IkiWiki/Plugin/htmltidy.pm +++ b/IkiWiki/Plugin/htmltidy.pm @@ -20,9 +20,10 @@ sub sanitize (@) { #{{{ 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--; @@ -39,7 +40,11 @@ sub sanitize (@) { #{{{ close OUT; local $/ = undef; - return <IN>; + my $ret=<IN>; + close IN; + waitpid $pid, 0; + + return $ret; } # }}} 1 |