components/cups/patches/07-scf-active.patch
changeset 481 9ca5b97b5b08
parent 480 e031a1a0c3a1
child 482 be3d0ad01572
--- a/components/cups/patches/07-scf-active.patch	Thu Aug 18 21:38:10 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
---- Makedefs.in.orig	Mon Aug 31 23:17:04 2009
-+++ Makedefs.in	Mon Aug 31 23:17:04 2009
-@@ -124,7 +124,7 @@
- BACKLIBS	=	@BACKLIBS@
- BANNERTOPS	=	@BANNERTOPS@
- CFLAGS		=	@CPPFLAGS@ @CFLAGS@
--COMMONLIBS	=	@LIBS@
-+COMMONLIBS	=	@LIBS@ -lscf
- CUPSDLIBS	=	@CUPSDLIBS@
- CXXFLAGS	=	@CPPFLAGS@ @CXXFLAGS@
- CXXLIBS		=	@CXXLIBS@
---- cups/http.c.orig	Mon Aug  9 23:15:55 2010
-+++ cups/http.c	Tue Dec  7 01:16:04 2010
-@@ -396,7 +396,35 @@
-   return (httpConnectEncrypt(host, port, HTTP_ENCRYPT_IF_REQUESTED));
- }
- 
-+/*
-+ * Test to see if CUPS is the "active" print service on Solaris by looking for
-+ * a special "general/active" boolean property in the CUPS service instance
-+ * svc:/application/cups/scheduler:default.  If it exists and is true, CUPS
-+ * is the active print service.
-+ */
-+#include <libscf.h>
- 
-+static int
-+cups_is_active()
-+{
-+  int active = 0;
-+
-+  scf_simple_prop_t *prop = scf_simple_prop_get(NULL, 
-+                                   "svc:/application/cups/scheduler:default",
-+                                   "general", "active");
-+
-+  if ((prop != NULL) && (scf_simple_prop_numvalues(prop) > 0)) {
-+      uint8_t *value = scf_simple_prop_next_boolean(prop);
-+
-+      if (value != NULL)
-+      active = *value;
-+    }
-+
-+  scf_simple_prop_free(prop);
-+
-+  return (active);
-+}
-+
- /*
-  * 'httpConnectEncrypt()' - Connect to a HTTP server using encryption.
-  */
-@@ -460,6 +488,10 @@
-   if (!host)
-     return (NULL);
- 
-+  /* Check to see if CUPS is the "active" print service on Solaris */
-+  if (cups_is_active() == 0)
-+    return (NULL);
-+
-   httpInitialize();
- 
-  /*