]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix the signal handlers in the dnssd and usb backends to only use async-safe
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 31 Jul 2015 13:29:25 +0000 (13:29 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 31 Jul 2015 13:29:25 +0000 (13:29 +0000)
functions (STR #4671)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12818 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
backend/dnssd.c
backend/usb-darwin.c

index d2be290088c854bc593f36f7413336bc6375c098..522301d5db5496741204484e5c9929e22a154e18 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES.txt - 2.1rc1 - 2015-07-30
+CHANGES.txt - 2.1rc1 - 2015-07-31
 ---------------------------------
 
 CHANGES IN CUPS V2.1rc1
@@ -8,6 +8,7 @@ CHANGES IN CUPS V2.1rc1
        - Fixed bugs in the new journald support (STR #4655, STR #4658,
          STR #4661)
        - Fixed domain socket support on Linux (STR #4679)
+       - Fixed signal handlers in the dnssd and usb backends (STR #4671)
        - Configure script changes for systemd support (STR #4669)
        - Updated autoconf sources to use newer form of AC_INIT (STR #4664)
 
index 29e003fb2500e380d6a80279353e68f744589e87..9afdecfe8c21f9e1a01a15b80d7fc68ebc294fd8 100644 (file)
@@ -1289,7 +1289,7 @@ sigterm_handler(int sig)          /* I - Signal number (unused) */
   (void)sig;
 
   if (job_canceled)
-    exit(CUPS_BACKEND_OK);
+    _exit(CUPS_BACKEND_OK);
   else
     job_canceled = 1;
 }
index ece2a37c9451d5d4a12debcb999e96d1300fbc46..2bf9615c8df229af3f1acc2858d8930ce9506918 100644 (file)
@@ -2285,13 +2285,13 @@ sigterm_handler(int sig)                /* I - Signal */
     while (waitpid(child_pid, &status, 0) < 0 && errno == EINTR);
 
     if (WIFEXITED(status))
-      exit(WEXITSTATUS(status));
+      _exit(WEXITSTATUS(status));
     else if (status == SIGTERM || status == SIGKILL)
-      exit(0);
+      _exit(0);
     else
     {
-      fprintf(stderr, "DEBUG: Child crashed on signal %d\n", status);
-      exit(CUPS_BACKEND_STOP);
+      write(2, "DEBUG: Child crashed.\n", 22);
+      _exit(CUPS_BACKEND_STOP);
     }
   }
 #endif /* __i386__ || __x86_64__ */