summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-07-01 20:20:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:06 -0500
commit3382b0a21af393b4b40956c139224867daf4c848 (patch)
tree9a79769bbac6d80432c2bb5abd30dd22c34a54c5 /source3/client
parent0b3cfe4aab98f85e10bf2fb45c5aa03160323494 (diff)
downloadsamba-3382b0a21af393b4b40956c139224867daf4c848.tar.gz
samba-3382b0a21af393b4b40956c139224867daf4c848.tar.bz2
samba-3382b0a21af393b4b40956c139224867daf4c848.zip
r1320: Return an error when the last command read from stdin fails in smbclient +
prepare for better error checking in tar.. (This used to be commit 374f00b56b7e9bff08e70ee2d93538b2c7fde7b7)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c6
-rw-r--r--source3/client/clitar.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index ea8ec93f97..1fccfaa581 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2579,9 +2579,10 @@ static void readline_callback(void)
Process commands on stdin.
****************************************************************************/
-static void process_stdin(void)
+static int process_stdin(void)
{
const char *ptr;
+ int rc = 0;
while (1) {
pstring tok;
@@ -2609,13 +2610,14 @@ static void process_stdin(void)
if (!next_token_nr(&ptr,tok,NULL,sizeof(tok))) continue;
if ((i = process_tok(tok)) >= 0) {
- commands[i].fn();
+ rc = commands[i].fn();
} else if (i == -2) {
d_printf("%s: command abbreviation ambiguous\n",tok);
} else {
d_printf("%s: command not found\n",tok);
}
}
+ return rc;
}
/*****************************************************
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index e43b3e4cc5..64c194b54d 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -1357,9 +1357,8 @@ int cmd_tar(void)
if (!tar_parseargs(argcl, argl, buf, 0))
return 1;
- process_tar();
SAFE_FREE(argl);
- return 0;
+ return process_tar();
}
/****************************************************************************
@@ -1368,6 +1367,7 @@ Command line (option) version
int process_tar(void)
{
+ int rc = 0;
initarbuf();
switch(tar_type) {
case 'x':
@@ -1445,7 +1445,7 @@ int process_tar(void)
clipn = 0;
must_free_cliplist = False;
}
- return(0);
+ return rc;
}
/****************************************************************************