]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/printers.c
Implement CUPS-Create-Local-Printer operation and add test file.
[thirdparty/cups.git] / scheduler / printers.c
index f8511373e070b0a3fb6c25d73807532ad0df44b5..c3f92777147d1527ac4f3d59e726d6edb45bd7c2 100644 (file)
@@ -84,6 +84,8 @@ cupsdAddPrinter(const char *name)     /* I - Name of printer */
     return (NULL);
   }
 
+  _cupsRWInit(&p->lock);
+
   cupsdSetString(&p->name, name);
   cupsdSetString(&p->info, name);
   cupsdSetString(&p->hostname, ServerName);
@@ -2193,6 +2195,8 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
   if (!CommonData)
     cupsdCreateCommonData();
 
+  _cupsRWLockWrite(&p->lock);
+
  /*
   * Clear out old filters, if any...
   */
@@ -2521,6 +2525,8 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
 
   add_printer_defaults(p);
 
+  _cupsRWUnlock(&p->lock);
+
  /*
   * Let the browse protocols reflect the change
   */