diff options
author | Gerald Carter <jerry@samba.org> | 2005-11-21 15:52:10 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:29 -0500 |
commit | d381c125b0ffc269fd8671a855c9b899966a2320 (patch) | |
tree | f4c73a2c975649d72c815ff71f607da61d9c678f /source/utils | |
parent | 69e168197e576bac6d4b29bdca876243eb7caf68 (diff) | |
download | samba-d381c125b0ffc269fd8671a855c9b899966a2320.tar.gz samba-d381c125b0ffc269fd8671a855c9b899966a2320.tar.xz samba-d381c125b0ffc269fd8671a855c9b899966a2320.zip |
r11833: fix build issues in smbget with the Sun compiler. Reported by Richard Bollinger
Diffstat (limited to 'source/utils')
-rw-r--r-- | source/utils/smbget.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source/utils/smbget.c b/source/utils/smbget.c index e8069802ca9..eab5e5ac02f 100644 --- a/source/utils/smbget.c +++ b/source/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(); |