From fa0e236881e7b498716b68d2650e68d46196175c Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 20 Oct 2010 12:33:07 +0000 Subject: [PATCH] Missed these from r4818 git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4820 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/tools/cardos-tool.c | 5 ++++- src/tools/cryptoflex-tool.c | 5 ++++- src/tools/opensc-explorer.c | 9 ++++++--- src/tools/opensc-tool.c | 7 ++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/tools/cardos-tool.c b/src/tools/cardos-tool.c index f62042ae..aa6ba477 100644 --- a/src/tools/cardos-tool.c +++ b/src/tools/cardos-tool.c @@ -1132,8 +1132,11 @@ int main(int argc, char *const argv[]) sc_strerror(r)); return 1; } - if (verbose > 0) + + if (verbose > 1) { ctx->debug = verbose; + ctx->debug_file = stderr; + } if (opt_driver != NULL) { err = sc_set_card_driver(ctx, opt_driver); diff --git a/src/tools/cryptoflex-tool.c b/src/tools/cryptoflex-tool.c index 4e0a6ddf..4e02b586 100644 --- a/src/tools/cryptoflex-tool.c +++ b/src/tools/cryptoflex-tool.c @@ -1045,7 +1045,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); printf("Using card driver: %s\n", card->driver->name); diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c index 727a89cd..54e8e346 100644 --- a/src/tools/opensc-explorer.c +++ b/src/tools/opensc-explorer.c @@ -1192,7 +1192,7 @@ static int do_debug(int argc, char **argv) printf("Debug level set to %d\n", i); ctx->debug = i; if (i) { - ctx->debug_file = stdout; + ctx->debug_file = stderr; } else { ctx->debug_file = NULL; } @@ -1604,8 +1604,11 @@ int main(int argc, char * const argv[]) fprintf(stderr, "Failed to establish context: %s\n", sc_strerror(r)); return 1; } - if (verbose > 1) - ctx->debug = verbose-1; + + if (verbose > 1) { + ctx->debug = verbose; + ctx->debug_file = stderr; + } if (opt_driver != NULL) { err = sc_set_card_driver(ctx, opt_driver); diff --git a/src/tools/opensc-tool.c b/src/tools/opensc-tool.c index da215397..a55cab6b 100644 --- a/src/tools/opensc-tool.c +++ b/src/tools/opensc-tool.c @@ -726,7 +726,12 @@ 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; + } + if (do_get_conf_entry) { if ((err = opensc_get_conf_entry (opt_conf_entry))) goto end;