]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 9 May 2003 15:11:57 +0000 (15:11 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 9 May 2003 15:11:57 +0000 (15:11 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3694 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
scheduler/ipp.c
scheduler/main.c

index 6e49e7ab3a2438fd409c14146a6ff97344c7149c..1d3c1a106eae22c8651886e466ac5aef444ffd73 100644 (file)
@@ -1,8 +1,11 @@
 CHANGES-1.1.txt
 ---------------
 
-CHANGES IN CUPS V1.1.19
+CHANGES IN CUPS V1.1.19rc5
 
+       - The scheduler dropped the first non-alpha character
+         after an open brace when doing attribute substitutions
+         in banner pages (STR #77)
        - The scheduler child might send SIGUSR1 to the parent
          before the signal handler was installed; this didn't
          prevent the scheduler from starting but produced an
index 2760ace1a1be2ca1ec6db4fc583d3000bce43b50..1eece9a1b28853ebde9dd87b88d2a7a93a539f15 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.127.2.66 2003/04/26 17:19:42 mike Exp $"
+ * "$Id: ipp.c,v 1.127.2.67 2003/05/09 15:11:52 mike Exp $"
  *
  *   IPP routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -2346,7 +2346,7 @@ copy_banner(client_t   *con,      /* I - Client connection */
         * Ignore { followed by stuff that is not an attribute name...
        */
 
-        cupsFilePrintf(out, "{%s", attrname);
+        cupsFilePrintf(out, "{%s%c", attrname, ch);
        continue;
       }
 
@@ -6621,5 +6621,5 @@ validate_user(client_t   *con,            /* I - Client connection */
 
 
 /*
- * End of "$Id: ipp.c,v 1.127.2.66 2003/04/26 17:19:42 mike Exp $".
+ * End of "$Id: ipp.c,v 1.127.2.67 2003/05/09 15:11:52 mike Exp $".
  */
index e6fc34ddd54d6af5e61f165bfdbe18c119f5cfcf..43791bcdc8933dbb067a119320ef1c386942636f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: main.c,v 1.57.2.45 2003/05/02 15:54:50 mike Exp $"
+ * "$Id: main.c,v 1.57.2.46 2003/05/09 15:11:57 mike Exp $"
  *
  *   Scheduler main loop for the Common UNIX Printing System (CUPS).
  *
  *   ReleaseSignals()     - Release signals for delivery.
  *   SetString()          - Set a string value.
  *   SetStringf()         - Set a formatted string value.
+ *   parent_handler()     - Catch USR1/CHLD signals...
  *   sigchld_handler()    - Handle 'child' signals from old processes.
  *   sighup_handler()     - Handle 'hangup' signals to reconfigure the scheduler.
  *   sigterm_handler()    - Handle 'terminate' signals that stop the scheduler.
- *   sigusr1_handler()    - Catch USR1 signals...
  *   usage()              - Show scheduler usage.
  */
 
  * Local functions...
  */
 
+static void    parent_handler(int sig);
 static void    sigchld_handler(int sig);
 static void    sighup_handler(int sig);
 static void    sigterm_handler(int sig);
-static void    sigusr1_handler(int sig);
 static void    usage(void);
 
 
@@ -67,6 +67,7 @@ static void   usage(void);
  * Local globals...
  */
 
+static int     parent_signal = 0;      /* Set to signal number from child */
 static int     holdcount = 0;          /* Number of time "hold" was called */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
 static sigset_t        holdmask;               /* Old POSIX signal mask */
@@ -176,21 +177,24 @@ main(int  argc,                           /* I - Number of command-line arguments */
     */
 
 #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
-    sigset(SIGUSR1, sigusr1_handler);
+    sigset(SIGUSR1, parent_handler);
+    sigset(SIGCHLD, parent_handler);
 
     sigset(SIGHUP, SIG_IGN);
 #elif defined(HAVE_SIGACTION)
     memset(&action, 0, sizeof(action));
     sigemptyset(&action.sa_mask);
     sigaddset(&action.sa_mask, SIGUSR1);
-    action.sa_handler = sigusr1_handler;
+    action.sa_handler = parent_handler;
     sigaction(SIGUSR1, &action, NULL);
+    sigaction(SIGCHLD, &action, NULL);
 
     sigemptyset(&action.sa_mask);
     action.sa_handler = SIG_IGN;
     sigaction(SIGHUP, &action, NULL);
 #else
-    signal(SIGUSR1, sigusr1_handler);
+    signal(SIGUSR1, parent_handler);
+    signal(SIGCLD, parent_handler);
 
     signal(SIGHUP, SIG_IGN);
 #endif /* HAVE_SIGSET */
@@ -198,18 +202,23 @@ main(int  argc,                           /* I - Number of command-line arguments */
     if (fork() > 0)
     {
      /*
-      * OK, wait for the child to startup and send us SIGUSR1...  We
-      * also need to ignore SIGHUP which might be sent by the init
-      * script to restart the scheduler...
+      * OK, wait for the child to startup and send us SIGUSR1 or to crash
+      * and the OS send us SIGCHLD...  We also need to ignore SIGHUP which
+      * might be sent by the init script to restart the scheduler...
       */
 
-      if (wait(&i) < 0)
-        i = 0;
+      for (; parent_signal == 0;)
+        sleep(1);
 
-      if (i == 0)
+      if (parent_signal == SIGUSR1)
         return (0);
 
-      if (i >= 256)
+      if (wait(&i) < 0)
+      {
+        perror("cupsd");
+       i = 1;
+      }
+      else if (i >= 256)
         fprintf(stderr, "cupsd: Child exited with status %d!\n", i / 256);
       else
         fprintf(stderr, "cupsd: Child exited on signal %d!\n", i);
@@ -870,6 +879,21 @@ SetStringf(char       **s,         /* O - New string */
 }
 
 
+/*
+ * 'parent_handler()' - Catch USR1/CHLD signals...
+ */
+
+static void
+parent_handler(int sig)                /* I - Signal */
+{
+ /*
+  * Store the signal we got from the OS and return...
+  */
+
+  parent_signal = sig;
+}
+
+
 /*
  * 'sigchld_handler()' - Handle 'child' signals from old processes.
  */
@@ -1051,17 +1075,6 @@ sigterm_handler(int sig)         /* I - Signal */
 }
 
 
-/*
- * 'sigusr1_handler()' - Catch USR1 signals...
- */
-
-static void
-sigusr1_handler(int sig)               /* I - Signal */
-{
-  (void)sig;   /* remove compiler warnings... */
-}
-
-
 /*
  * 'usage()' - Show scheduler usage.
  */
@@ -1075,5 +1088,5 @@ usage(void)
 
 
 /*
- * End of "$Id: main.c,v 1.57.2.45 2003/05/02 15:54:50 mike Exp $".
+ * End of "$Id: main.c,v 1.57.2.46 2003/05/09 15:11:57 mike Exp $".
  */