]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 10 Mar 2003 19:07:17 +0000 (19:07 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 10 Mar 2003 19:07:17 +0000 (19:07 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3439 7a7537e8-13f0-0310-91df-b6672ffda945

scheduler/classes.c
scheduler/printers.c

index 6c9135040070db80833213365093b1c62148d909..e157b873e2b3f50a500b93b27a08c61e7322d1e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: classes.c,v 1.34.2.10 2003/01/29 20:08:20 mike Exp $"
+ * "$Id: classes.c,v 1.34.2.11 2003/03/10 19:07:17 mike Exp $"
  *
  *   Printer class routines for the Common UNIX Printing System (CUPS).
  *
@@ -458,18 +458,20 @@ LoadAllClasses(void)
        * Add the missing remote printer...
        */
 
-       temp = AddPrinter(value);
-       strcpy(temp->make_model, "Remote Printer on unknown");
+       if ((temp = AddPrinter(value)) != NULL)
+       {
+         strcpy(temp->make_model, "Remote Printer on unknown");
 
-        temp->state       = IPP_PRINTER_STOPPED;
-       temp->type        |= CUPS_PRINTER_REMOTE;
-       temp->browse_time = 2147483647;
+          temp->state       = IPP_PRINTER_STOPPED;
+         temp->type        |= CUPS_PRINTER_REMOTE;
+         temp->browse_time = 2147483647;
 
-       SetString(&temp->location, "Location Unknown");
-       SetString(&temp->info, "No Information Available");
-       temp->hostname[0] = '\0';
+         SetString(&temp->location, "Location Unknown");
+         SetString(&temp->info, "No Information Available");
+         temp->hostname[0] = '\0';
 
-       SetPrinterAttrs(temp);
+         SetPrinterAttrs(temp);
+       }
       }
 
       if (temp)
@@ -673,5 +675,5 @@ SaveAllClasses(void)
 
 
 /*
- * End of "$Id: classes.c,v 1.34.2.10 2003/01/29 20:08:20 mike Exp $".
+ * End of "$Id: classes.c,v 1.34.2.11 2003/03/10 19:07:17 mike Exp $".
  */
index 807e2f3eb4b18db1b3f222596b15639ac45de029..c84928c535153c3a89a522480f59593766b87acd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.93.2.37 2003/02/18 22:43:28 mike Exp $"
+ * "$Id: printers.c,v 1.93.2.38 2003/03/10 19:07:17 mike Exp $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -75,12 +75,12 @@ AddPrinter(const char *name)        /* I - Name of printer */
                *prev;          /* Previous printer in list */
 
 
-  DEBUG_printf(("AddPrinter(\"%s\")\n", name));
-
  /*
   * Range check input...
   */
 
+  LogMessage(L_DEBUG2, "AddPrinter(\"%s\")", name ? name : "(null)");
+
   if (name == NULL)
     return (NULL);
 
@@ -89,7 +89,11 @@ AddPrinter(const char *name) /* I - Name of printer */
   */
 
   if ((p = calloc(1, sizeof(printer_t))) == NULL)
+  {
+    LogMessage(L_ERROR, "Unable to allocate memory for printer - %s",
+               strerror(errno));
     return (NULL);
+  }
 
   SetString(&p->name, name);
   SetString(&p->info, name);
@@ -2154,5 +2158,5 @@ write_irix_state(printer_t *p)    /* I - Printer to update */
 
 
 /*
- * End of "$Id: printers.c,v 1.93.2.37 2003/02/18 22:43:28 mike Exp $".
+ * End of "$Id: printers.c,v 1.93.2.38 2003/03/10 19:07:17 mike Exp $".
  */