All error exit with 0 , for sample in smb_download_file, all success states is return 1, but main and readrcfile and clean_exit return 0 as success. for sample: $ smbget -N smb://unk/none && echo "downloaded ok." || echo "Fail to download." Downloaded 0b in 0 seconds downloaded ok.
Created attachment 1880 [details] With this patch smbget would return 0 on every INCOMPLETE download and would return 1 on a SUCCESSFUL download The following test cases would certainly clarify the output the Reporter must have got which made him file the bug ================================================================================= $ ./main.exe false && echo " success" || echo " failure" false success ( when the program returns 0 ) $ ./main.exe true && echo " success" || echo " failure" true failure ( when the program returns 1 ) $ cat main.c #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc , char *argv[]) { if (strcmp(argv[1] , "true") == 0 ) { printf("\n true"); return 1; } else{ printf("\n false"); return 0; } } $ true && echo " success" || echo " failure" success $ false && echo " success" || echo " failure" failure
Created attachment 1881 [details] With this patch smbget would return 0 on every INCOMPLETE download and would return 1 on a SUCCESSFUL download The following test cases would certainly clarify the output the Max must have got which made him file the bug ================================================================================= $ ./main.exe false && echo " success" || echo " failure" false success ( when the program returns 0 ) $ ./main.exe true && echo " success" || echo " failure" true failure ( when the program returns 1 ) $ cat main.c #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc , char *argv[]) { if (strcmp(argv[1] , "true") == 0 ) { printf("\n true"); return 1; } else{ printf("\n false"); return 0; } } $ true && echo " success" || echo " failure" success $ false && echo " success" || echo " failure" failure
smbget extis always with 1 on errors and exits with 0 on success. Looks completely fine here with a 4.1 smbget