libcupsfilters: Moved signal handling back into main function of get_printer_attributes() variants
@@ -163,37 +163,6 @@ ipp_t *get_printer_attributes4(const char* raw_uri,
int debug,
int is_fax)
{
- #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
- struct sigaction action; /* Actions for POSIX signals */
-#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
-
- /*
- * Make sure status messages are not buffered...
- */
-
- setbuf(stderr, NULL);
-
- /*
- * Ignore broken pipe signals...
- */
-
- signal(SIGPIPE, SIG_IGN);
-
- /*
- * Register a signal handler to cleanly cancel a job.
- */
-
-#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
- sigset(SIGTERM, cancel_job);
-#elif defined(HAVE_SIGACTION)
- memset(&action, 0, sizeof(action));
-
- sigemptyset(&action.sa_mask);
- action.sa_handler = cancel_job;
- sigaction(SIGTERM, &action, NULL);
-#else
- signal(SIGTERM, cancel_job);
-#endif /* HAVE_SIGSET */
if(is_fax)
return get_printer_attributes5(NULL, raw_uri, pattrs, pattrs_size,
req_attrs, req_attrs_size, debug,NULL,IPPFIND_BASED_CONVERTER_FOR_FAX_URI);
@@ -202,6 +171,7 @@ ipp_t *get_printer_attributes4(const char* raw_uri,
req_attrs, req_attrs_size, debug,NULL,IPPFIND_BASED_CONVERTER_FOR_PRINT_URI);
}
+
/* Get attributes of a printer specified by URI and under a given HTTP
connection, for example via a domain socket, and give info about used
fallbacks */
@@ -259,6 +229,37 @@ get_printer_attributes5(http_t *http_printer,
"uri-security-supported"
};
+#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
+ struct sigaction action; /* Actions for POSIX signals */
+#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+
+ /*
+ * Make sure status messages are not buffered...
+ */
+
+ setbuf(stderr, NULL);
+
+ /*
+ * Ignore broken pipe signals...
+ */
+
+ signal(SIGPIPE, SIG_IGN);
+
+ /*
+ * Register a signal handler to cleanly cancel a job.
+ */
+
+#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
+ sigset(SIGTERM, cancel_job);
+#elif defined(HAVE_SIGACTION)
+ memset(&action, 0, sizeof(action));
+ sigemptyset(&action.sa_mask);
+ action.sa_handler = cancel_job;
+ sigaction(SIGTERM, &action, NULL);
+#else
+ signal(SIGTERM, cancel_job);
+#endif /* HAVE_SIGSET */
+
/* Expect a device capable of standard IPP Everywhere*/
if (driverless_info != NULL)
*driverless_info = FULL_DRVLESS;
