The Samba-Bugzilla – Attachment 5225 Details for
Bug 7069
smbget does not return an error status after some errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
clean up smbget return status in case of some errors
samba-3.4.5-smbget.c_errorcode.patch (text/plain), 1.95 KB, created by
Johannes Poehlmann
on 2010-01-27 09:51:11 UTC
(
hide
)
Description:
clean up smbget return status in case of some errors
Filename:
MIME Type:
Creator:
Johannes Poehlmann
Created:
2010-01-27 09:51:11 UTC
Size:
1.95 KB
patch
obsolete
>--- source3/utils/smbget.c.orig 2010-01-27 11:38:14.927686692 +0100 >+++ source3/utils/smbget.c 2010-01-27 14:13:30.315445279 +0100 >@@ -51,6 +51,7 @@ > > static int smb_download_file(const char *base, const char *name, int recursive, int resume, char *outfile); > >+/* result 0 indicates error */ > static int get_num_cols(void) > { > #ifdef TIOCGWINSZ >@@ -116,6 +117,7 @@ > free(wgtmp); free(usertmp); > } > >+/* result 0 indicates error */ > static int smb_download_dir(const char *base, const char *name, int resume) > { > char path[SMB_MAXPATHLEN]; >@@ -258,6 +260,7 @@ > free(filename); free(status); > } > >+/* result 0 indicates error */ > static int smb_download_file(const char *base, const char *name, int recursive, int resume, char *outfile) { > int remotehandle, localhandle; > time_t start_time = time(NULL); >@@ -279,8 +282,7 @@ > fprintf(stderr, "%s is a directory. Specify -R to download recursively\n", path); > return 0; > } >- smb_download_dir(base, name, resume); >- return 0; >+ return smb_download_dir(base, name, resume); > > case ENOENT: > fprintf(stderr, "%s can't be found on the remote server\n", path); >@@ -326,7 +328,7 @@ > if(verbose) > printf("%s is up-to-date, skipping\n", newpath); > smbc_close(remotehandle); >- return 0; >+ return 1; /* NOOP, not regarded as error */ > } > /* else open it for writing and truncate if it exists */ > localhandle = open(newpath, O_CREAT | O_NONBLOCK | O_RDWR | O_TRUNC, 0775); >@@ -499,6 +501,7 @@ > clean_exit(); > } > >+/* return code 0 = ok */ > static int readrcfile(const char *name, const struct poptOption long_options[]) > { > FILE *fd = fopen(name, "r"); >@@ -652,9 +655,9 @@ > > while ( (file = poptGetArg(pc)) ) { > if (!recursive) >- return smb_download_file(file, "", recursive, resume, outputfile); >+ return ! smb_download_file(file, "", recursive, resume, outputfile) ; > else >- return smb_download_dir(file, "", resume); >+ return ! smb_download_dir(file, "", resume) ; > } > > clean_exit();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7069
:
5225
|
5228
|
5236
|
5237
|
5245