SignAllArc(jartree, keyName, javascript, metafile, install_script, optimize, !noRecurse);
if(SignAllArc(jartree, keyName, javascript, metafile, install_script, optimize, !noRecurse)) { retval = -1; goto cleanup; }
main(int argc, char *argv[]){	PRBool readOnly;	int retval=0;	outputFD = PR_STDOUT;	errorFD = PR_STDERR;	progName = argv[0];  if (argc < 2)    {    usage();    }	excludeDirs = PL_NewHashTable(10, PL_HashString, PL_CompareStrings,					PL_CompareStrings, NULL, NULL);	extensions = PL_NewHashTable(10, PL_HashString, PL_CompareStrings,					PL_CompareStrings, NULL, NULL);	if(parse_args(argc, argv)) {		retval = -1;		goto cleanup;	}	/* Parse the command file if one was given */	if(cmdFile) {		if(ProcessCommandFile()) {			retval = -1;			goto cleanup;		}	}	/* Set up output redirection */	if(outfile) {		if(PR_Access(outfile, PR_ACCESS_EXISTS)==PR_SUCCESS) {			/* delete the file if it is already present */			PR_fprintf(errorFD,				"warning: %s already exists and will be overwritten.\n",				outfile);			warningCount++;			if(PR_Delete(outfile) != PR_SUCCESS) {				PR_fprintf(errorFD, "ERROR: unable to delete %s.\n", outfile);				errorCount++;				exit(ERRX);			}		}		outputFD = PR_Open(outfile,			PR_WRONLY|PR_CREATE_FILE|PR_TRUNCATE, 0777);		if(!outputFD) {			PR_fprintf(errorFD, "ERROR: Unable to create %s.\n", outfile);			errorCount++;			exit(ERRX);		}		errorFD = outputFD;	}  /* This seems to be a fairly common user error */  if (verify && list_certs > 0)    {    PR_fprintf (errorFD, "%s: Can't use -l and -v at the same time\n",		PROGRAM_NAME);	errorCount++;	retval = -1;    goto cleanup;    }  /* -J assumes -Z now */  if (javascript && zipfile)    {    PR_fprintf (errorFD, "%s: Can't use -J and -Z at the same time\n",		PROGRAM_NAME);    PR_fprintf (errorFD, "%s: -J option will create the jar files for you\n",		PROGRAM_NAME);	errorCount++;	retval = -1;	goto cleanup;    }  /* Less common mixing of -L with various options */	if (list_certs > 0 &&         (tell_who || zipfile || javascript ||            scriptdir || extensionsGiven || exclusionsGiven || install_script)) {		PR_fprintf(errorFD, "%s: Can't use -l or -L with that option\n",			PROGRAM_NAME);		errorCount++;		retval = -1;		goto cleanup;	}	if (!cert_dir)		cert_dir = get_default_cert_dir();	VerifyCertDir(cert_dir, keyName);	if(	compression_level < MIN_COMPRESSION_LEVEL ||	 compression_level > MAX_COMPRESSION_LEVEL) {		PR_fprintf(errorFD, "Compression level must be between %d and %d.\n",		 MIN_COMPRESSION_LEVEL, MAX_COMPRESSION_LEVEL);		errorCount++;		retval = -1;		goto cleanup;	}	if(jartree && !keyName) {		PR_fprintf(errorFD, "You must specify a key with which to sign.\n");		errorCount++;		retval = -1;		goto cleanup;	}	readOnly = (genkey == NULL); /* only key generation requires write */	if(InitCrypto(cert_dir, readOnly)) {		PR_fprintf(errorFD, "ERROR: Cryptographic initialization failed.\n");		errorCount++;		retval = -1;		goto cleanup;	}  if (verify)    {    VerifyJar(verify);    }  else if (list_certs)    {    ListCerts(keyName, list_certs);    }  else if (list_modules)    {    JarListModules();    }  else if (genkey)    {    GenerateCert(genkey, keySize, token);    }  else if (tell_who)    {    JarWho(tell_who);    }  else if (javascript && jartree)    {	/* make sure directory exists */	PRDir *dir;	dir = PR_OpenDir(jartree);	if(!dir) {		PR_fprintf(errorFD, "ERROR: unable to open directory %s.\n", jartree);		errorCount++;		retval = -1;		goto cleanup;	} else {		PR_CloseDir(dir);	}    /* undo junk from prior runs of signtool*/    if(RemoveAllArc(jartree)) {		PR_fprintf(errorFD, "Error removing archive directories under %s\n", jartree);		errorCount++;		retval = -1;		goto cleanup;	}    /* traverse all the htm|html files in the directory */    if(InlineJavaScript(jartree, !noRecurse)) {		retval = -1;		goto cleanup;	}    /* sign any resultant .arc directories created in above step */    SignAllArc(jartree, keyName, javascript, metafile, install_script,		optimize, !noRecurse);	if(!leaveArc) {		RemoveAllArc(jartree);	}	if(errorCount>0 || warningCount>0) {		PR_fprintf(outputFD, "%d error%s, %d warning%s.\n", errorCount,			errorCount==1?"":"s", warningCount, warningCount==1?"":"s");	} else {		PR_fprintf(outputFD, "Directory %s signed successfully.\n", jartree);	}  } else if (jartree)    {    SignArchive(jartree, keyName, zipfile, javascript, metafile,		install_script, optimize, !noRecurse);    }  else    usage();cleanup:	if(extensions) {		PL_HashTableDestroy(extensions); extensions = NULL;	}	if(excludeDirs) {		PL_HashTableDestroy(excludeDirs); excludeDirs = NULL;	}	if(outputFD != PR_STDOUT) {		PR_Close(outputFD);	}	rm_dash_r(TMP_OUTPUT);  return retval;}