chiark / gitweb /
mason/pastebin/%show: Don't flush FS buffers in `filter' child.
[odin-cgi] / mason / pastebin / %show
index d8573b5bd23d1042bf7949ed833586c8157b17e5..3a8edb355bcbf2227c231e77ee6be519a53f0463 100644 (file)
@@ -82,6 +82,7 @@
 %#
 <%once>
        use utf8;
+       use POSIX qw(_exit);
 
        sub filter ($$$@) {
          my ($what, $m, $content, @cmd) = @_;
@@ -90,7 +91,7 @@
            open my $hl, "|-", @cmd or die "open $what: $!";
            syswrite $hl, $content // die "$what write: $!";
            close $hl or die "$what kid: $!, $?";
-           exit 0;
+           _exit 0;
          } else {
            while (sysread $fh, my $buf, 8192) { $m->print($buf); }
            close $fh and waitpid $kid, 0