tools: -v sets ctx->debug only if set more than once. -vv also makes the debug go to stderr.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4818 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
2d6e3bd262
commit
6a750e6cc0
|
@ -542,7 +542,10 @@ int main(
|
|||
fprintf(stderr,"Establish-Context failed: %s\n", sc_strerror(r));
|
||||
exit(1);
|
||||
}
|
||||
ctx->debug=debug;
|
||||
if (debug > 1) {
|
||||
ctx->debug = debug;
|
||||
ctx->debug_file = stderr;
|
||||
}
|
||||
if(ctx->debug>0)
|
||||
printf("Context for application \"%s\" created, Debug=%d\n", ctx->app_name, ctx->debug);
|
||||
|
||||
|
|
|
@ -518,6 +518,11 @@ int main(int argc, char * const argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (verbose > 1) {
|
||||
ctx->debug = verbose;
|
||||
ctx->debug_file = stderr;
|
||||
}
|
||||
|
||||
if (action_count <= 0)
|
||||
goto end;
|
||||
|
||||
|
|
|
@ -568,7 +568,10 @@ int main(int argc, char * const argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
ctx->debug = verbose;
|
||||
if (verbose > 1) {
|
||||
ctx->debug = verbose;
|
||||
ctx->debug_file = stderr;
|
||||
}
|
||||
|
||||
err = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose);
|
||||
if (err)
|
||||
|
|
|
@ -1714,7 +1714,11 @@ int main(int argc, char * const argv[])
|
|||
fprintf(stderr, "Failed to establish context: %s\n", sc_strerror(r));
|
||||
return 1;
|
||||
}
|
||||
ctx->debug = verbose;
|
||||
|
||||
if (verbose > 1) {
|
||||
ctx->debug = verbose;
|
||||
ctx->debug_file = stderr;
|
||||
}
|
||||
|
||||
err = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose);
|
||||
if (err)
|
||||
|
|
|
@ -487,7 +487,10 @@ int main(int argc, char* argv[])
|
|||
return -1;
|
||||
}
|
||||
|
||||
ctx->debug = opt_debug;
|
||||
if (opt_debug > 1) {
|
||||
ctx->debug = opt_debug;
|
||||
ctx->debug_file = stderr;
|
||||
}
|
||||
|
||||
if (util_connect_card(ctx, &card, opt_reader, opt_wait, opt_debug) != 0)
|
||||
err = -1;
|
||||
|
|
|
@ -440,8 +440,10 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
ctx->debug = verbose-1;
|
||||
if (verbose > 1) {
|
||||
ctx->debug = verbose;
|
||||
ctx->debug_file = stderr;
|
||||
}
|
||||
|
||||
if (opt_driver != NULL)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue