From: msweet Date: Fri, 31 Jul 2015 13:29:25 +0000 (+0000) Subject: Fix the signal handlers in the dnssd and usb backends to only use async-safe X-Git-Tag: v2.2b1~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1de66f911cd527a5dda4f2839f03b28dc23a7a9;p=thirdparty%2Fcups.git Fix the signal handlers in the dnssd and usb backends to only use async-safe functions (STR #4671) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12818 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES.txt b/CHANGES.txt index d2be290088..522301d5db 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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) diff --git a/backend/dnssd.c b/backend/dnssd.c index 29e003fb25..9afdecfe8c 100644 --- a/backend/dnssd.c +++ b/backend/dnssd.c @@ -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; } diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index ece2a37c94..2bf9615c8d 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -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__ */