diff options
author | Werner Koch <[email protected]> | 2015-04-06 12:07:50 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2015-04-06 12:07:50 +0000 |
commit | c581ed717ad2cc4be90c46253baa44a0d3ba5b80 (patch) | |
tree | 83c9f8632e773ca6261e74701226f9fbef80f2e8 /g10/gpg.c | |
parent | Rename DBG_ASSUAN to DBG_IPC and add separate DBG_EXTPROG. (diff) | |
download | gnupg-c581ed717ad2cc4be90c46253baa44a0d3ba5b80.tar.gz gnupg-c581ed717ad2cc4be90c46253baa44a0d3ba5b80.zip |
gpg: Add new option --debug-iolbf.
* g10/gpg.c (oDebugIOLBF): new.
(opts): Add --debug-iolbf.
(main): Set option.
--
This option is convenient for debugging to make sure that debug output
to stderr is synced with output to stdout.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | g10/gpg.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -196,7 +196,7 @@ enum cmd_and_opt_values oDebug, oDebugLevel, oDebugAll, - oDebugCCIDDriver, + oDebugIOLBF, oStatusFD, oStatusFile, oAttributeFD, @@ -557,6 +557,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_p_u (oDebug, "debug", "@"), ARGPARSE_s_s (oDebugLevel, "debug-level", "@"), ARGPARSE_s_n (oDebugAll, "debug-all", "@"), + ARGPARSE_s_n (oDebugIOLBF, "debug-iolbf", "@"), ARGPARSE_s_i (oStatusFD, "status-fd", "@"), ARGPARSE_s_s (oStatusFile, "status-file", "@"), ARGPARSE_s_i (oAttributeFD, "attribute-fd", "@"), @@ -2158,6 +2159,8 @@ main (int argc, char **argv) while( arg_parse( &pargs, opts) ) { if( pargs.r_opt == oDebug || pargs.r_opt == oDebugAll ) parse_debug++; + else if (pargs.r_opt == oDebugIOLBF) + es_setvbuf (es_stdout, NULL, _IOLBF, 0); else if( pargs.r_opt == oOptions ) { /* yes there is one, so we do not try the default one, but * read the option file when it is encountered at the commandline @@ -2419,6 +2422,8 @@ main (int argc, char **argv) case oDebugAll: opt.debug = ~0; break; case oDebugLevel: debug_level = pargs.r.ret_str; break; + case oDebugIOLBF: break; /* Already set in pre-parse step. */ + case oStatusFD: set_status_fd ( translate_sys2libc_fd_int (pargs.r.ret_int, 1) ); break; |