resolved conflicts in merge of 3fa92bed to lmp-mr1-dev-plus-aosp

Change-Id: I5630bddc1dd2f5ce9d9f6091903c0cf6cafc38ca
This commit is contained in:
Dan Albert 2014-11-20 18:26:58 -08:00
commit 460c3f1630
2 changed files with 8 additions and 6 deletions

View File

@ -25,9 +25,11 @@ static struct {
void usage(char *arg0)
{
int i;
fprintf(stderr, "%s must be called on a policy file with a component and the appropriate arguments specified\n", arg0);
fprintf(stderr, "%s <policy-file>:\n", arg0);
for(int i = 0; i < NUM_COMPONENTS; i++) {
for(i = 0; i < NUM_COMPONENTS; i++) {
analyze_components[i].usage();
}
exit(1);
@ -38,13 +40,13 @@ int main(int argc, char **argv)
char *policy;
struct policy_file pf;
policydb_t policydb;
int rc;
int rc, i;
if (argc < 3)
usage(argv[0]);
policy = argv[1];
if(load_policy(policy, &policydb, &pf))
exit(1);
for(int i = 0; i < NUM_COMPONENTS; i++) {
for(i = 0; i < NUM_COMPONENTS; i++) {
if (!strcmp(analyze_components[i].key, argv[2])) {
rc = analyze_components[i].func(argc - 2, argv + 2, &policydb);
if (rc && USAGE_ERROR) {
@ -53,4 +55,7 @@ int main(int argc, char **argv)
}
}
usage(argv[0]);
// will never be called due to exit() call in usage
exit(1);
}

View File

@ -281,9 +281,6 @@ int typecmp_func (int argc, char **argv, policydb_t *policydb) {
case 'e':
equiv = 1;
break;
case 'w':
case 'z':
break;
default:
USAGE_ERROR = true;
return -1;