]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
implicitclass : Removed warning related to dup 121/head
authordeepak0405 <patankardeepak04@gmail.com>
Mon, 20 May 2019 16:31:48 +0000 (22:01 +0530)
committerdeepak0405 <patankardeepak04@gmail.com>
Mon, 20 May 2019 16:31:48 +0000 (22:01 +0530)
backend/implicitclass.c

index 2ef9f512e69a015746ca10780bee84cff14a8026..2268d9e70708788b63e9b5463aa336094b135630 100644 (file)
@@ -138,7 +138,7 @@ main(int  argc,                             /* I - Number of command-line args */
   int     bytes;      /* Bytes copied */
   char uri[HTTP_MAX_URI];
   char    *argv_nt[7];
-  int     outbuflen,filefd,exit_status;
+  int     outbuflen,filefd,exit_status,dup_status;
   static const char *pattrs[] =
                 {
                   "printer-defaults"
@@ -369,7 +369,11 @@ main(int  argc,                            /* I - Number of command-line args */
          find whether the filter worked correctly and what was the
          document-format of the filtered output.*/
       close(1);
-      /*dup(filefd);*/
+      dup_status = dup(filefd);
+      if(dup_status < 0) {
+        fprintf(stderr, "Could not write the output of pdftoippprinter printer to tmp file\n");
+        return CUPS_BACKEND_FAILED;
+      }
 
       /* Calling pdftoippprinter.c filter*/
       apply_filters(7,argv_nt);