X-Git-Url: http://git.samba.org/samba.git/?p=nivanova%2Fsamba-autobuild%2F.git;a=blobdiff_plain;f=source3%2Ftorture%2Fsmbiconv.c;h=88ad6fef60976f69d5a317d515670d4cf5e15932;hp=c4d30164e47ab3ab5cdc755c9f6f064e4fe015ba;hb=0e771263eed0b9bc364ce523765ea17dd1192841;hpb=dd255b427515d0f22695185bd78c16bc58de6c09 diff --git a/source3/torture/smbiconv.c b/source3/torture/smbiconv.c index c4d30164e47..88ad6fef609 100644 --- a/source3/torture/smbiconv.c +++ b/source3/torture/smbiconv.c @@ -21,6 +21,8 @@ */ #include "includes.h" +#include "system/filesys.h" +#include "popt_common.h" #undef realloc static int @@ -86,7 +88,7 @@ incomplete character or shift sequence at end of buffer")); static int -process_fd (iconv_t cd, int fd, FILE *output) +process_fd (smb_iconv_t cd, int fd, FILE *output) { /* we have a problem with reading from a descriptor since we must not provide the iconv() function an incomplete character or shift @@ -168,8 +170,8 @@ process_fd (iconv_t cd, int fd, FILE *output) int main(int argc, char *argv[]) { const char *file = NULL; - char *from = ""; - char *to = ""; + const char *from = ""; + const char *to = ""; char *output = NULL; const char *preload_modules[] = {NULL, NULL}; FILE *out = stdout; @@ -200,7 +202,7 @@ int main(int argc, char *argv[]) /* the following functions are part of the Samba debugging facilities. See lib/debug.c */ - setup_logging("smbiconv", True); + setup_logging("smbiconv", DEBUG_STDOUT); if (preload_modules[0]) smb_load_modules(preload_modules); @@ -214,8 +216,9 @@ int main(int argc, char *argv[]) } cd = smb_iconv_open(to, from); - if((int)cd == -1) { + if (cd == (smb_iconv_t)-1) { DEBUG(0,("unable to find from or to encoding, exiting...\n")); + if (out != stdout) fclose(out); return 1; }