X-Git-Url: http://git.samba.org/?p=samba.git;a=blobdiff_plain;f=source3%2Fclient%2Fclitar.c;h=dcc176b9d145da87466fb7fb6a371336fcddec4f;hp=4978a4dec154ca39dba8adf787e41a52c9ade438;hb=8dac09c5a15bbf17cf69975bff84106eba6147e9;hpb=2cc786548b4460525ce2e0bf09209eee48a5ea08 diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 4978a4dec15..dcc176b9d14 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -71,6 +71,7 @@ stack dir_stack = {NULL, 0}; /* Want an empty stack */ #define SEPARATORS " \t\n\r" extern int DEBUGLEVEL; extern struct cli_state *cli; +extern FILE *dbf; /* These defines are for the do_setrattr routine, to indicate * setting and reseting of file attributes in the function call */ @@ -1818,6 +1819,12 @@ int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind) if (Optind>=argc || !strcmp(argv[Optind], "-")) { /* Sets tar handle to either 0 or 1, as appropriate */ tarhandle=(tar_type=='c'); + /* + * Make sure that dbf points to stderr if we are using stdout for + * tar output + */ + if (tarhandle == 1) + dbf = stderr; } else { if (tar_type=='c' && (dry_run || strcmp(argv[Optind], "/dev/null")==0)) {