diff options
author | James Peach <jpeach@samba.org> | 2006-06-15 23:51:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:30 -0500 |
commit | 06491a4cb12d8753c63525b3ba4d754d2ab1e822 (patch) | |
tree | 305b4dbe67646ac5e09cfc599a66ea334acd69f9 /source3/client/client.c | |
parent | ae2fb4f1093e28e4656371b9bbeb229fd1ed1ada (diff) | |
download | samba-06491a4cb12d8753c63525b3ba4d754d2ab1e822.tar.gz samba-06491a4cb12d8753c63525b3ba4d754d2ab1e822.tar.bz2 samba-06491a4cb12d8753c63525b3ba4d754d2ab1e822.zip |
r16274: Fix the smbclient prompting behaviour for both systems that have
libreadline and those that don't. We always use the built-in readline
replacement for non-interactive mode. Interactive prompts are always
emitted to stdout and non-interactive mode never prompts at all.
Introduce x_fdup to avoid spuriously closing stdout when a logfile is
specified on the command line and setup_logging is called a second time.
(This used to be commit 848ac756f651a4be231e5635580c0fd5f3d3fa0e)
Diffstat (limited to 'source3/client/client.c')
-rw-r--r-- | source3/client/client.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 94fcaaca00..d7fe4d43c3 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -3422,8 +3422,9 @@ static int do_message_op(void) /* set default debug level to 0 regardless of what smb.conf sets */ setup_logging( "smbclient", True ); DEBUGLEVEL_CLASS[DBGC_ALL] = 1; - dbf = x_stderr; - x_setbuf( x_stderr, NULL ); + if ((dbf = x_fdup(x_stderr))) { + x_setbuf( dbf, NULL ); + } pc = poptGetContext("smbclient", argc, (const char **) argv, long_options, POPT_CONTEXT_KEEP_FIRST); |