am 0be02b36: Merge "Fix sepolicy-analyze build with different toolchains"

* commit '0be02b360fa94836d9ebdbd59790f7b3fcde950b':
  Fix sepolicy-analyze build with different toolchains
This commit is contained in:
Daniel Cashman 2014-12-02 20:40:34 +00:00 committed by Android Git Automerger
commit 598b87c2ef

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);
@ -39,12 +41,14 @@ int main(int argc, char **argv)
struct policy_file pf;
policydb_t policydb;
int rc;
int 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 +57,5 @@ int main(int argc, char **argv)
}
}
usage(argv[0]);
exit(0);
}