summaryrefslogtreecommitdiffstats
path: root/source3/client/clitar.c
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2013-07-09 15:10:44 +0200
committerAndreas Schneider <asn@samba.org>2014-02-19 18:22:26 +0100
commit60eec86ceb08814dabb986219f756d1645efb82c (patch)
tree4f18d1ec8e87bd07129bfe1abf633cdd7a60f735 /source3/client/clitar.c
parentb753900b09e6b5001042e45388b72ad36e8a0093 (diff)
downloadsamba-60eec86ceb08814dabb986219f756d1645efb82c.tar.gz
samba-60eec86ceb08814dabb986219f756d1645efb82c.tar.xz
samba-60eec86ceb08814dabb986219f756d1645efb82c.zip
clitar.c, client.c: add flag to know if there's a tar operation to do.
- remove tar_type global. Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com> [ddiss@samba.org: rebase against lp_cli_maxprotocol() changes] Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/client/clitar.c')
-rw-r--r--source3/client/clitar.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 6c3bbd7d4f..83b4a96fc5 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -26,11 +26,6 @@
#define LEN(x) (sizeof(x)/sizeof((x)[0]))
#define TAR_MAX_BLOCK_SIZE 65535
-/*
- * XXX: used in client.c, we have to export it for now.
- * corresponds to the transfer operation. Can be '\0', 'c' or 'x'
- */
-char tar_type = 0;
enum tar_operation {
TAR_NO_OPERATION,
@@ -51,6 +46,8 @@ enum {
};
struct tar {
+ bool to_process;
+
/* flags */
struct tar_mode {
enum tar_operation operation; /* create, extract */
@@ -145,6 +142,7 @@ static void tar_dump(struct tar *t)
XSET(TAR_EXCLUDE),
};
+ XBOOL(t->to_process);
XTABLE(t->mode.operation, op);
XTABLE(t->mode.selection, sel);
XINT(t->mode.blocksize);
@@ -218,6 +216,11 @@ static bool tar_read_inclusion_file (struct tar *t, const char* filename)
return 1;
}
+bool tar_to_process (struct tar *t)
+{
+ return t->to_process;
+}
+
/**
* cmd_block - interactive command to change tar blocksize
*
@@ -461,6 +464,7 @@ int tar_parse_args(struct tar* t, const char *flag, const char **val, int valsiz
t->mode.operation = TAR_NO_OPERATION;
t->mode.selection = TAR_NO_SELECTION;
t->mode.dry = false;
+ t->to_process = false;
while (*flag) {
switch(*flag++) {
@@ -609,6 +613,7 @@ int tar_parse_args(struct tar* t, const char *flag, const char **val, int valsiz
}
}
+ t->to_process = true;
tar_dump(t);
return 1;
}