first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[kai/samba.git] / source / smbwrapper / smbw.c
index faaa9f047b0537b9aa552f97d010361215a4c1ba..4c246e1e40af6ac4848d36239b78ce23de2ac2cd 100644 (file)
@@ -81,7 +81,7 @@ void smbw_init(void)
 
        lp_load(servicesf,True,False,False);
 
-       get_myname(global_myname,NULL);
+       get_myname(global_myname);
 
        if ((p=smbw_getshared("DEBUG"))) {
                DEBUGLEVEL = atoi(p);
@@ -93,11 +93,11 @@ void smbw_init(void)
 
        if ((p=smbw_getshared("PREFIX"))) {
                slprintf(smbw_prefix,sizeof(fstring)-1, "/%s/", p);
-               string_sub(smbw_prefix,"//", "/");
+               all_string_sub(smbw_prefix,"//", "/", 0);
                DEBUG(2,("SMBW_PREFIX is %s\n", smbw_prefix));
        }
 
-       slprintf(line,sizeof(line)-1,"PWD_%d", getpid());
+       slprintf(line,sizeof(line)-1,"PWD_%d", (int)getpid());
        
        p = smbw_getshared(line);
        if (!p) {
@@ -320,7 +320,7 @@ char *smbw_parse_path(const char *fname, char *server, char *share, char *path)
 
        pstrcpy(path,p);
 
-       string_sub(path, "/", "\\");
+       all_string_sub(path, "/", "\\", 0);
 
  ok:
        DEBUG(4,("parsed path name=%s cwd=%s [%s] [%s] [%s]\n", 
@@ -341,6 +341,9 @@ int smbw_path(const char *path)
        char *cwd;
        int len;
 
+       if(!path)
+               return 0;
+
        /* this is needed to prevent recursion with the BSD malloc which
           opens /etc/malloc.conf on the first call */
        if (strncmp(path,"/etc/", 5) == 0) {
@@ -378,7 +381,7 @@ int smbw_errno(struct cli_state *c)
        uint32 ecode;
        int ret;
 
-       ret = cli_error(c, &eclass, &ecode);
+       ret = cli_error(c, &eclass, &ecode, NULL);
 
        if (ret) {
                DEBUG(3,("smbw_error %d %d (0x%x) -> %d\n", 
@@ -1385,7 +1388,7 @@ int smbw_fork(void)
                smbw_srv_close(srv);
        }
 
-       slprintf(line,sizeof(line)-1,"PWD_%d", getpid());
+       slprintf(line,sizeof(line)-1,"PWD_%d", (int)getpid());
        smbw_setshared(line,smbw_cwd);
 
        /* unblock the parent */