summaryrefslogtreecommitdiffstats
path: root/source3/utils/smbget.c
diff options
context:
space:
mode:
authorCharles <neologix@free.fr>2008-03-11 19:49:08 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-03-11 19:49:08 +0100
commit3634d987840bd3ea3e679e02500fc76bb974818f (patch)
tree855d13c8bae42ad2120746e857ca5c74c23bfd23 /source3/utils/smbget.c
parentb83234cf4028f067f274754786e66bb071df7cd9 (diff)
downloadsamba-3634d987840bd3ea3e679e02500fc76bb974818f.tar.gz
samba-3634d987840bd3ea3e679e02500fc76bb974818f.tar.xz
samba-3634d987840bd3ea3e679e02500fc76bb974818f.zip
The attached patch removes some global variables, and make them local to main().
(This used to be commit 50cab87d3ee6d701dd8847f4e0a058f5e2d80e0f)
Diffstat (limited to 'source3/utils/smbget.c')
-rw-r--r--source3/utils/smbget.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index e8fd6be6e67..1b284c17253 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -29,7 +29,7 @@
static int columns = 0;
-static int _resume, _recursive, debuglevel, update;
+static int debuglevel, update;
static char *outputfile;
@@ -540,13 +540,14 @@ int main(int argc, const char **argv)
const char *file = NULL;
char *rcfile = NULL;
bool smb_encrypt = false;
+ int resume = 0, recursive = 0;
TALLOC_CTX *frame = talloc_stackframe();
struct poptOption long_options[] = {
{"guest", 'a', POPT_ARG_NONE, NULL, 'a', "Work as user guest" },
{"encrypt", 'e', POPT_ARG_NONE, NULL, 'e', "Encrypt SMB transport (UNIX extended servers only)" },
- {"resume", 'r', POPT_ARG_NONE, &_resume, 0, "Automatically resume aborted files" },
+ {"resume", 'r', POPT_ARG_NONE, &resume, 0, "Automatically resume aborted files" },
{"update", 'U', POPT_ARG_NONE, &update, 0, "Download only when remote file is newer than local file or local file is missing"},
- {"recursive", 'R', POPT_ARG_NONE, &_recursive, 0, "Recursively download files" },
+ {"recursive", 'R', POPT_ARG_NONE, &recursive, 0, "Recursively download files" },
{"username", 'u', POPT_ARG_STRING, &username, 'u', "Username to use" },
{"password", 'p', POPT_ARG_STRING, &password, 'p', "Password to use" },
{"workgroup", 'w', POPT_ARG_STRING, &workgroup, 'w', "Workgroup to use (optional)" },
@@ -595,11 +596,11 @@ int main(int argc, const char **argv)
}
}
- if((send_stdout || _resume || outputfile) && update) {
+ if((send_stdout || resume || outputfile) && update) {
fprintf(stderr, "The -o, -R or -O and -U options can not be used together.\n");
return 1;
}
- if((send_stdout || outputfile) && _recursive) {
+ if((send_stdout || outputfile) && recursive) {
fprintf(stderr, "The -o or -O and -R options can not be used together.\n");
return 1;
}
@@ -626,10 +627,10 @@ int main(int argc, const char **argv)
total_start_time = time(NULL);
while ( (file = poptGetArg(pc)) ) {
- if (!_recursive)
- return smb_download_file(file, "", _recursive, _resume, outputfile);
+ if (!recursive)
+ return smb_download_file(file, "", recursive, resume, outputfile);
else
- return smb_download_dir(file, "", _resume);
+ return smb_download_dir(file, "", resume);
}
clean_exit();