In post-processing we stop assigning the file descriptorof the input
pipe to stdin and then read the data from stdin but instead, read the
data directly from stdin.
Without this improvement in some cases, especially when we do not have
a PPD file, we are not able to get the output data of the previous
step (Poppler's pdftops or Ghostscript to turn PDF to PostScript, and
the really strange is that this only happens when we call pdftops()
from the universal() filter function).
* Child comes here...
*/
- dup2(post_proc_pipe[0], 0);
- close(post_proc_pipe[0]);
close(post_proc_pipe[1]);
if (ppd)
{
else
dup2(outputfd, 1);
- fp = cupsFileStdin();
+ fp = cupsFileOpenFd(post_proc_pipe[0], "r");
if (renderer == ACROREAD)
{
fwrite(buffer, 1, bytes, stdout);
}
}
+ close(post_proc_pipe[0]);
exit(0);
}