ctf_loader: hack to minimally use the argp passed

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2008-10-08 10:46:34 -03:00
parent 19704cf67e
commit d4812cadd6
2 changed files with 8 additions and 3 deletions

View File

@ -788,13 +788,15 @@ static void open_files(struct ctf_state *sp, const char *in_filename)
}
}
int ctf__load(struct cus *self, struct argp *argp __unused,
int argc, char *argv[])
int ctf__load(struct cus *self, struct argp *argp, int argc, char *argv[])
{
struct ctf_state state;
memset(&state, 0, sizeof(state));
if (argc > 2 && argp_parse(argp, argc - 1, argv, 0, NULL, NULL))
return -1;
open_files(&state, argv[argc - 1]);
if (elf_version(EV_CURRENT) == EV_NONE) {

View File

@ -891,7 +891,10 @@ static error_t pahole__options_parser(int key, char *arg,
struct argp_state *state)
{
switch (key) {
case ARGP_KEY_INIT: state->child_inputs[0] = state->input; break;
case ARGP_KEY_INIT:
if (state->child_inputs != NULL)
state->child_inputs[0] = state->input;
break;
case 'A': class__include_nested_anonymous = 1; break;
case 'a': class__include_anonymous = 1; break;
case 'B': nr_bit_holes = atoi(arg); break;