+ } until defined $pid;
+
+ if (! $pid) {
+ $tries=10;
+ $pid=undef;
+
+ do {
+ $pid = open(KID_TO_WRITE, "|-");
+ unless (defined $pid) {
+ $tries--;
+ if ($tries < 1) {
+ debug("failed to fork: $@");
+ print $params{content};
+ exit;
+ }
+ }
+ } until defined $pid;
+
+ if (! $pid) {
+ if (! exec 'otl2html', '-S', '/dev/null', '-T', '/dev/stdin') {
+ debug("failed to run otl2html: $@");
+ print $params{content};
+ exit;
+ }
+ }
+
+ print KID_TO_WRITE $params{content};
+ close KID_TO_WRITE;
+ waitpid $pid, 0;
+ exit;