comparison cinst/mozilla.c @ 317:46fd11699646

Renamed exit code from return_code to exit_code.
author Sascha Wilde <wilde@intevation.de>
date Fri, 04 Apr 2014 15:11:09 +0200
parents b832231640ab
children 1628615d904e
comparison
equal deleted inserted replaced
316:43416dcbcc50 317:46fd11699646
90 * This will be retuned by the programm and might be set to an 90 * This will be retuned by the programm and might be set to an
91 * error code on fatal errors and to and warning code on non-fatal 91 * error code on fatal errors and to and warning code on non-fatal
92 * errors. In case of mor than one warning the warning codes will be 92 * errors. In case of mor than one warning the warning codes will be
93 * ORed together. 93 * ORed together.
94 */ 94 */
95 int return_code = 0; 95 int exit_code = 0;
96 96
97 /** 97 /**
98 * @brief Return configuration base directory. 98 * @brief Return configuration base directory.
99 * @returns A pointer to a string containing the path to the base 99 * @returns A pointer to a string containing the path to the base
100 * directory holding the configuration directories for e.g. mozilla 100 * directory holding the configuration directories for e.g. mozilla
192 free (fqpath); 192 free (fqpath);
193 } 193 }
194 else 194 else
195 { 195 {
196 DEBUGPRINTF("WARN! Non existent profile path: '%s'\n", path); 196 DEBUGPRINTF("WARN! Non existent profile path: '%s'\n", path);
197 return_code |= WARN_MOZ_PROFILE_DOES_NOT_EXIST; 197 exit_code |= WARN_MOZ_PROFILE_DOES_NOT_EXIST;
198 } 198 }
199 } 199 }
200 else if (str_equal(key, "IsRelative") && 200 else if (str_equal(key, "IsRelative") &&
201 str_starts_with(value, "1")) 201 str_starts_with(value, "1"))
202 relative_path = true; 202 relative_path = true;
205 fclose(inifile); 205 fclose(inifile);
206 } 206 }
207 else 207 else
208 { 208 {
209 DEBUGPRINTF("WARN! Could not open ini file: '%s'\n", inifile_name); 209 DEBUGPRINTF("WARN! Could not open ini file: '%s'\n", inifile_name);
210 return_code |= WARN_MOZ_FAILED_TO_OPEN_INI; 210 exit_code |= WARN_MOZ_FAILED_TO_OPEN_INI;
211 } 211 }
212 return dirs; 212 return dirs;
213 } 213 }
214 214
215 /** 215 /**
628 DEBUGPRINTF("Opening %s for input...\n", argv[1]); 628 DEBUGPRINTF("Opening %s for input...\n", argv[1]);
629 if ((input_stream = fopen(argv[1], "r")) == NULL) 629 if ((input_stream = fopen(argv[1], "r")) == NULL)
630 { 630 {
631 DEBUGPRINTF("FATAL: Could not open %s for reading!\n", 631 DEBUGPRINTF("FATAL: Could not open %s for reading!\n",
632 argv[1]); 632 argv[1]);
633 return_code = ERR_MOZ_FAILED_TO_OPEN_INPUT; 633 exit_code = ERR_MOZ_FAILED_TO_OPEN_INPUT;
634 goto exit; 634 goto exit;
635 } 635 }
636 break; 636 break;
637 default: 637 default:
638 DEBUGPRINTF("FATAL: Wrong number of arguments!\n"); 638 DEBUGPRINTF("FATAL: Wrong number of arguments!\n");
639 return_code = ERR_MOZ_WRONG_ARGC; 639 exit_code = ERR_MOZ_WRONG_ARGC;
640 goto exit; 640 goto exit;
641 } 641 }
642 642
643 dbdirs = 643 dbdirs =
644 get_all_nssdb_dirs(); 644 get_all_nssdb_dirs();
652 for (int i=0; dbdirs[i] != NULL; i++) 652 for (int i=0; dbdirs[i] != NULL; i++)
653 DEBUG_nss_list_certs(dbdirs[i]); 653 DEBUG_nss_list_certs(dbdirs[i]);
654 #endif 654 #endif
655 655
656 if (! apply_to_certs_and_profiles(remove_cert, &certs_to_remove, dbdirs)) 656 if (! apply_to_certs_and_profiles(remove_cert, &certs_to_remove, dbdirs))
657 return_code |= WARN_MOZ_COULD_NOT_REMOVE_CERT; 657 exit_code |= WARN_MOZ_COULD_NOT_REMOVE_CERT;
658 658
659 if (! apply_to_certs_and_profiles(import_cert, &certs_to_add, dbdirs)) 659 if (! apply_to_certs_and_profiles(import_cert, &certs_to_add, dbdirs))
660 return_code |= WARN_MOZ_COULD_NOT_ADD_CERT; 660 exit_code |= WARN_MOZ_COULD_NOT_ADD_CERT;
661 661
662 #ifdef DEBUGOUTPUT 662 #ifdef DEBUGOUTPUT
663 DEBUGPRINTF("NEW List of installed certs:\n"); 663 DEBUGPRINTF("NEW List of installed certs:\n");
664 for (int i=0; dbdirs[i] != NULL; i++) 664 for (int i=0; dbdirs[i] != NULL; i++)
665 DEBUG_nss_list_certs(dbdirs[i]); 665 DEBUG_nss_list_certs(dbdirs[i]);
669 } 669 }
670 670
671 fclose(input_stream); 671 fclose(input_stream);
672 672
673 exit: 673 exit:
674 exit(return_code); 674 exit(exit_code);
675 } 675 }

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