summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-11-21 15:52:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:29 -0500
commitaef9a5fdc11cffd3c489ed41794fbb3616006205 (patch)
tree94a7d1809170e6d7f278c52af5fcb20a9e09536f /source3
parent65540512df2a0072b88c63195a61b0ab8054cf8a (diff)
downloadsamba-aef9a5fdc11cffd3c489ed41794fbb3616006205.tar.gz
samba-aef9a5fdc11cffd3c489ed41794fbb3616006205.tar.bz2
samba-aef9a5fdc11cffd3c489ed41794fbb3616006205.zip
r11833: fix build issues in smbget with the Sun compiler. Reported by Richard Bollinger
(This used to be commit d381c125b0ffc269fd8671a855c9b899966a2320)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/smbget.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index e8069802ca..eab5e5ac02 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -28,6 +28,10 @@
int columns = 0;
+static int _resume, _recursive, debuglevel;
+static char *outputfile;
+
+
time_t total_start_time = 0;
off_t total_bytes = 0;
@@ -507,16 +511,13 @@ int readrcfile(const char *name, const struct poptOption long_options[])
int main(int argc, const char **argv)
{
- int resume = 0, recursive = 0;
int c = 0;
- int debuglevel = 0;
const char *file = NULL;
char *rcfile = NULL;
- char *outputfile = NULL;
struct poptOption long_options[] = {
{"guest", 'a', POPT_ARG_NONE, NULL, 'a', "Work as user guest" },
- {"resume", 'r', POPT_ARG_NONE, &resume, 0, "Automatically resume aborted files" },
- {"recursive", 'R', POPT_ARG_NONE, &recursive, 0, "Recursively download files" },
+ {"resume", 'r', POPT_ARG_NONE, &_resume, 0, "Automatically resume aborted 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)" },
@@ -537,7 +538,8 @@ int main(int argc, const char **argv)
/* only read rcfile if it exists */
asprintf(&rcfile, "%s/.smbgetrc", getenv("HOME"));
- if(access(rcfile, F_OK) == 0) readrcfile(rcfile, long_options);
+ if(access(rcfile, F_OK) == 0)
+ readrcfile(rcfile, long_options);
free(rcfile);
#ifdef SIGWINCH
@@ -559,7 +561,7 @@ int main(int argc, const char **argv)
}
}
- 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;
}
@@ -578,9 +580,11 @@ 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);
- else return smb_download_dir(file, "", resume);
+ while ( (file = poptGetArg(pc)) ) {
+ if (!_recursive)
+ return smb_download_file(file, "", _recursive, _resume, outputfile);
+ else
+ return smb_download_dir(file, "", _resume);
}
clean_exit();