# HG changeset patch # User Sascha Wilde # Date 1396444933 -7200 # Node ID 0f73fe4230c1db9721a27b74326ca38c07883756 # Parent 6c4b3ff4a356abdcb68871bb3fdb52b0aeb7f287 Fixed and optimized production build. diff -r 6c4b3ff4a356 -r 0f73fe4230c1 cinst/mozilla.c --- 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); }