]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Now restart queue if printer is modified.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 14 Dec 1999 20:41:28 +0000 (20:41 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 14 Dec 1999 20:41:28 +0000 (20:41 +0000)
Only set printer state to idle if it was busy in StopJob.

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

scheduler/ipp.c
scheduler/job.c

index e5a048525d403ed6776e07f40ba0d6ba761bfa4e..ba2d8d043f82e4948b3821ddc84f9d2af4c88a0c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.36 1999/12/07 18:10:18 mike Exp $"
+ * "$Id: ipp.c,v 1.37 1999/12/14 20:41:27 mike Exp $"
  *
  *   IPP routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -868,6 +868,16 @@ add_printer(client_t        *con,  /* I - Client connection */
 
   SetPrinterAttrs(printer);
   SaveAllPrinters();
+
+  if (printer->job != NULL)
+  {
+   /*
+    * Stop the current job and then restart it below...
+    */
+
+    StopJob(((job_t *)printer->job)->id);
+  }
+
   CheckJobs();
 
   LogMessage(LOG_INFO, "New printer \'%s\' added by \'%s\'.", printer->name,
@@ -2611,5 +2621,5 @@ validate_job(client_t        *con,        /* I - Client connection */
 
 
 /*
- * End of "$Id: ipp.c,v 1.36 1999/12/07 18:10:18 mike Exp $".
+ * End of "$Id: ipp.c,v 1.37 1999/12/14 20:41:27 mike Exp $".
  */
index b2a6ff8d7606ce0507dfce2473d9a532cb3d4a06..37e391fc178d3b3a49daee8896f3b225853d87b6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: job.c,v 1.41 1999/10/12 18:29:30 mike Exp $"
+ * "$Id: job.c,v 1.42 1999/12/14 20:41:28 mike Exp $"
  *
  *   Job management routines for the Common UNIX Printing System (CUPS).
  *
@@ -742,17 +742,19 @@ StopJob(int id)
 
         if (current->status)
          SetPrinterState(current->printer, IPP_PRINTER_STOPPED);
-       else
+       else if (current->printer->state == IPP_PRINTER_BUSY)
          SetPrinterState(current->printer, IPP_PRINTER_IDLE);
 
-       current->state          = IPP_JOB_STOPPED;
-        current->printer->job   = NULL;
-        current->printer        = NULL;
+       current->state        = IPP_JOB_STOPPED;
+        current->printer->job = NULL;
+        current->printer      = NULL;
 
         for (i = 0; current->procs[i]; i ++)
          if (current->procs[i] > 0)
+         {
            kill(current->procs[i], SIGTERM);
-       current->procs[0] = 0;
+           current->procs[i] = 0;
+         }
 
         if (current->pipe)
         {
@@ -976,5 +978,5 @@ start_process(char *command,        /* I - Full path to command */
 
 
 /*
- * End of "$Id: job.c,v 1.41 1999/10/12 18:29:30 mike Exp $".
+ * End of "$Id: job.c,v 1.42 1999/12/14 20:41:28 mike Exp $".
  */