]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Group all of the OS errors together for ease of use.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 18 Feb 2003 22:43:09 +0000 (22:43 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 18 Feb 2003 22:43:09 +0000 (22:43 +0000)
Updated the scheduler to log the OS error or PPD error as appropriate.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@3375 7a7537e8-13f0-0310-91df-b6672ffda945

cups/ppd.c
cups/ppd.h
scheduler/printers.c
systemv/cupstestppd.c

index b51a5cc58fbf41f0994bce10c61d86fdd9386e81..79cc9c4b8d233a4c18e1b5ebe8268d3f69cc0374 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.90 2003/02/18 22:23:38 mike Exp $"
+ * "$Id: ppd.c,v 1.91 2003/02/18 22:43:06 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -292,8 +292,8 @@ ppdErrorString(ppd_status_t status) /* I - PPD status */
                  "OK",
                  "Unable to open PPD file",
                  "NULL PPD file pointer",
-                 "Missing PPD-Adobe-4.x header",
                  "Memory allocation error",
+                 "Missing PPD-Adobe-4.x header",
                  "Missing value string",
                  "Internal error",
                  "Bad OpenGroup",
@@ -2941,5 +2941,5 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
 
 /*
- * End of "$Id: ppd.c,v 1.90 2003/02/18 22:23:38 mike Exp $".
+ * End of "$Id: ppd.c,v 1.91 2003/02/18 22:43:06 mike Exp $".
  */
index 961e0d7259e68fccaaa43362668092857cf3d05d..dcb079913e255374c8f2e565dfb53c1fe820e31e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.h,v 1.31 2003/02/18 22:23:38 mike Exp $"
+ * "$Id: ppd.h,v 1.32 2003/02/18 22:43:07 mike Exp $"
  *
  *   PostScript Printer Description definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -105,8 +105,8 @@ typedef enum                        /**** Status Codes ****/
   PPD_OK = 0,                  /* OK */
   PPD_FILE_OPEN_ERROR,         /* Unable to open PPD file */
   PPD_NULL_FILE,               /* NULL PPD file pointer */
-  PPD_MISSING_PPDADOBE4,       /* Missing PPD-Adobe-4.x header */
   PPD_ALLOC_ERROR,             /* Memory allocation error */
+  PPD_MISSING_PPDADOBE4,       /* Missing PPD-Adobe-4.x header */
   PPD_MISSING_VALUE,           /* Missing value string */
   PPD_INTERNAL_ERROR,          /* Internal error */
   PPD_BAD_OPEN_GROUP,          /* Bad OpenGroup */
@@ -321,5 +321,5 @@ extern ppd_status_t ppdLastError(int *line);
 #endif /* !_CUPS_PPD_H_ */
 
 /*
- * End of "$Id: ppd.h,v 1.31 2003/02/18 22:23:38 mike Exp $".
+ * End of "$Id: ppd.h,v 1.32 2003/02/18 22:43:07 mike Exp $".
  */
index f2e04f7bf3c4e91811f673ff3fe777a173ce0d9e..1a2db3e6b2fd7fe89b8f1e9fa6301afaccd8dc60 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.138 2003/02/14 20:09:15 mike Exp $"
+ * "$Id: printers.c,v 1.139 2003/02/18 22:43:07 mike Exp $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -1407,8 +1407,12 @@ SetPrinterAttrs(printer_t *p)            /* I - Printer to setup */
         pstatus = ppdLastError(&pline);
 
        LogMessage(L_ERROR, "PPD file for %s cannot be loaded!", p->name);
-       LogMessage(L_ERROR, "%s on line %d.", ppdErrorString(pstatus),
-                  pline);
+
+       if (pstatus <= PPD_ALLOC_ERROR)
+         LogMessage(L_ERROR, "%s", strerror(errno));
+        else
+         LogMessage(L_ERROR, "%s on line %d.", ppdErrorString(pstatus),
+                    pline);
 
        AddPrinterFilter(p, "application/vnd.cups-postscript 0 -");
       }
@@ -2141,5 +2145,5 @@ write_irix_state(printer_t *p)    /* I - Printer to update */
 
 
 /*
- * End of "$Id: printers.c,v 1.138 2003/02/14 20:09:15 mike Exp $".
+ * End of "$Id: printers.c,v 1.139 2003/02/18 22:43:07 mike Exp $".
  */
index d98b6bf08c3c120ef102b3731d26738f122e59b5..735ff853d8dce55f02f2b2685254ec28d484abf1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupstestppd.c,v 1.10 2003/02/18 22:23:39 mike Exp $"
+ * "$Id: cupstestppd.c,v 1.11 2003/02/18 22:43:09 mike Exp $"
  *
  *   PPD test program for the Common UNIX Printing System (CUPS).
  *
@@ -190,7 +190,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
       {
         error = ppdLastError(&line);
 
-       if (error <= PPD_NULL_FILE || error == PPD_ALLOC_ERROR)
+       if (error <= PPD_ALLOC_ERROR)
        {
          status = ERROR_FILE_OPEN;
 
@@ -831,5 +831,5 @@ usage(void)
 
 
 /*
- * End of "$Id: cupstestppd.c,v 1.10 2003/02/18 22:23:39 mike Exp $".
+ * End of "$Id: cupstestppd.c,v 1.11 2003/02/18 22:43:09 mike Exp $".
  */