changeset 281:0f73fe4230c1

Fixed and optimized production build.
author Sascha Wilde <wilde@intevation.de>
date Wed, 02 Apr 2014 15:22:13 +0200
parents 6c4b3ff4a356
children d13d51f7a0e2
files cinst/mozilla.c
diffstat 1 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/cinst/mozilla.c	Wed Apr 02 13:47:06 2014 +0200
+++ b/cinst/mozilla.c	Wed Apr 02 15:22:13 2014 +0200
@@ -305,12 +305,13 @@
   return alldirs;
 }
 
+#ifdef DEBUGOUTPUT
 /**
  * @brief list certificates from nss certificate store
  * @param[in] confdir the directory with the certificate store
  */
 static void
-nss_list_certs (char *confdir)
+DEBUG_nss_list_certs (char *confdir)
 {
   CERTCertList *list;
   CERTCertListNode *node;
@@ -324,14 +325,17 @@
            node = CERT_LIST_NEXT(node)) {
         name = node->appData;
 
-        printf ("Found certificate \"%s\"\n", name);
+        DEBUGPRINTF("Found certificate \"%s\"\n", name);
       }
       CERT_DestroyCertList(list);
       NSS_Shutdown();
     }
   else
-    DEBUGPRINTF("Could not open nss certificate store in %s!\n", confdir);
+    {
+      DEBUGPRINTF("Could not open nss certificate store in %s!\n", confdir);
+    }
 }
+#endif
 
 /**
  * @brief Create a string with the name for cert in SECItem.
@@ -377,7 +381,9 @@
       return true;
     }
   else
-    DEBUGPRINTF("Base64 decode failed for: %s\n", b64);
+    {
+      DEBUGPRINTF("Base64 decode failed for: %s\n", b64);
+    }
   return false;
 }
 
@@ -589,9 +595,11 @@
     {
       parse_commands(&certs_to_add, &certs_to_remove);
 
-      puts("OLD List of installed certs:");
+#ifdef DEBUGOUTPUT
+      DEBUGPRINTF("OLD List of installed certs:");
       for (int i=0; pdirs[i] != NULL; i++)
-        nss_list_certs(pdirs[i]);
+        DEBUG_nss_list_certs(pdirs[i]);
+#endif
 
       if (! apply_to_certs_and_profiles(remove_cert, &certs_to_remove, pdirs))
         return_code |= WARN_MOZ_COULD_NOT_REMOVE_CERT;
@@ -599,9 +607,11 @@
       if (! apply_to_certs_and_profiles(import_cert, &certs_to_add, pdirs))
         return_code |= WARN_MOZ_COULD_NOT_ADD_CERT;
 
-      puts("NEW List of installed certs:");
+#ifdef DEBUGOUTPUT
+      DEBUGPRINTF("NEW List of installed certs:");
       for (int i=0; pdirs[i] != NULL; i++)
-        nss_list_certs(pdirs[i]);
+        DEBUG_nss_list_certs(pdirs[i]);
+#endif
 
       strv_free(pdirs);
     }

http://wald.intevation.org/projects/trustbridge/