]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: in pdftops() simplified feeding data into pstops()
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 24 Nov 2021 14:51:46 +0000 (15:51 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 24 Nov 2021 14:51:46 +0000 (15:51 +0100)
In the fork for running the pstops() filter function do notdo a file
descriptor redirection detour via stdin. pstops() accepts an input
file descriptor directly.

This made the pstops() filter not getting the job data when pdftops()
used Poppler's pdftops utility as PostScript interpreter when
pdftops() is called by the universal() filter function.

cupsfilters/pdftops.c

index 4ffbbea1f9344d2c27454b232f9debe709b69fee..78ecfa7cd9cc149ab672dd48df9b9c0ac04f9037 100644 (file)
@@ -1594,8 +1594,6 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     * Child comes here...
     */
 
-    dup2(pstops_pipe[0], 0);
-    close(pstops_pipe[0]);
     close(pstops_pipe[1]);
     if (need_post_proc)
     {
@@ -1603,7 +1601,8 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       close(post_proc_pipe[1]);
     }
 
-    ret = pstops(0, outputfd, 0, &pstops_filter_data, NULL);
+    ret = pstops(pstops_pipe[0], outputfd, 0, &pstops_filter_data, NULL);
+    close(pstops_pipe[0]);
 
     if (ret && log) log(ld, FILTER_LOGLEVEL_ERROR,
                        "pdftops: pstops filter function failed.");