]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 22 Apr 2002 21:10:25 +0000 (21:10 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 22 Apr 2002 21:10:25 +0000 (21:10 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@2349 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
berkeley/lpr.c
systemv/lp.c

index 741ec9254170c3fd1aa2ba123b2d3da54e61c3df..ce4fec474994754d6817da401be1efd7c82560ac 100644 (file)
@@ -5,6 +5,10 @@ CHANGES IN CUPS V1.1.15
 
        - Updated the CUPS license agreement for the new MacOS
          license exception.
+       - The lp and lpr commands now only override the SIGINT
+         handler if it is not being ignored (patch from Robert
+         Ambrose for some interactive software that catches
+         SIGINT and will gracefully cancel the print...)
        - The PostScript image filter (imagetops) now supports
          printing CMYK images using the CMYK colorspace.
        - The image filters now support CMYK JPEG files, and
index 6e4f9bfa378d5bd73053809cfa806bc46c7b6443..3853134012c19aa1a8ebd98e5b23f660c16ed4f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: lpr.c,v 1.20.2.3 2002/01/02 18:04:19 mike Exp $"
+ * "$Id: lpr.c,v 1.20.2.4 2002/04/22 21:10:25 mike Exp $"
  *
  *   "lpr" command for the Common UNIX Printing System (CUPS).
  *
@@ -84,6 +84,7 @@ main(int  argc,               /* I - Number of command-line arguments */
   int          temp;           /* Temporary file descriptor */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;     /* Signal action */
+  struct sigaction oldaction;  /* Old signal action */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
 
 
@@ -344,18 +345,22 @@ main(int  argc,           /* I - Number of command-line arguments */
 #ifndef WIN32
 #  if defined(HAVE_SIGSET)
     sigset(SIGHUP, sighandler);
-    sigset(SIGINT, sighandler);
+    if (sigset(SIGINT, sighandler) == SIG_IGN)
+      sigset(SIGINT, SIG_IGN);
     sigset(SIGTERM, sighandler);
 #  elif defined(HAVE_SIGACTION)
     memset(&action, 0, sizeof(action));
     action.sa_handler = sighandler;
 
     sigaction(SIGHUP, &action, NULL);
-    sigaction(SIGINT, &action, NULL);
+    sigaction(SIGINT, NULL, &oldaction);
+    if (oldaction.sa_handler != SIG_IGN)
+      sigaction(SIGINT, &action, NULL);
     sigaction(SIGTERM, &action, NULL);
 #  else
     signal(SIGHUP, sighandler);
-    signal(SIGINT, sighandler);
+    if (signal(SIGINT, sighandler) == SIG_IGN)
+      signal(SIGINT, SIG_IGN);
     signal(SIGTERM, sighandler);
 #  endif
 #endif /* !WIN32 */
@@ -421,5 +426,5 @@ sighandler(int s)   /* I - Signal number */
 
 
 /*
- * End of "$Id: lpr.c,v 1.20.2.3 2002/01/02 18:04:19 mike Exp $".
+ * End of "$Id: lpr.c,v 1.20.2.4 2002/04/22 21:10:25 mike Exp $".
  */
index b1c3d19b82392106ed8eb52ddcc8547976fc0229..b26d7f03f006045df59b67ae1418ee722ef71069 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: lp.c,v 1.29.2.4 2002/03/22 15:47:31 mike Exp $"
+ * "$Id: lp.c,v 1.29.2.5 2002/04/22 21:10:25 mike Exp $"
  *
  *   "lp" command for the Common UNIX Printing System (CUPS).
  *
@@ -86,6 +86,7 @@ main(int  argc,               /* I - Number of command-line arguments */
   int          temp;           /* Temporary file descriptor */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;     /* Signal action */
+  struct sigaction oldaction;  /* Old signal action */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET*/
 
 
@@ -506,18 +507,22 @@ main(int  argc,           /* I - Number of command-line arguments */
 #ifndef WIN32
 #  if defined(HAVE_SIGSET)
     sigset(SIGHUP, sighandler);
-    sigset(SIGINT, sighandler);
+    if (sigset(SIGINT, sighandler) == SIG_IGN)
+      sigset(SIGINT, SIG_IGN);
     sigset(SIGTERM, sighandler);
 #  elif defined(HAVE_SIGACTION)
     memset(&action, 0, sizeof(action));
     action.sa_handler = sighandler;
 
     sigaction(SIGHUP, &action, NULL);
-    sigaction(SIGINT, &action, NULL);
+    sigaction(SIGINT, NULL, &oldaction);
+    if (oldaction.sa_handler != SIG_IGN)
+      sigaction(SIGINT, &action, NULL);
     sigaction(SIGTERM, &action, NULL);
 #  else
     signal(SIGHUP, sighandler);
-    signal(SIGINT, sighandler);
+    if (signal(SIGINT, sighandler) == SIG_IGN)
+      signal(SIGINT, SIG_IGN);
     signal(SIGTERM, sighandler);
 #  endif
 #endif /* !WIN32 */
@@ -650,5 +655,5 @@ sighandler(int s)   /* I - Signal number */
 
 
 /*
- * End of "$Id: lp.c,v 1.29.2.4 2002/03/22 15:47:31 mike Exp $".
+ * End of "$Id: lp.c,v 1.29.2.5 2002/04/22 21:10:25 mike Exp $".
  */