r5302: fixed a compilation problem on solaris caused by the recent include
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 Feb 2005 06:36:30 +0000 (06:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:39 +0000 (13:09 -0500)
changes

source/client/client.c
source/client/smbmount.c
source/lib/util.c
source/librpc/rpc/dcerpc_util.c
source/ntvfs/simple/svfs_util.c
source/ntvfs/simple/vfs_simple.c
source/param/loadparm.c
source/rpc_server/dcerpc_sock.c
source/smbd/server.c
source/winbind/wb_server.c

index 5413beb3ba37adf4ff3604cb09823446860bd876..986f35b9713cd3bfe34fcbdecbcac6bbd77e5ede 100644 (file)
@@ -929,7 +929,7 @@ static void do_mget(struct clilist_file_info *finfo)
                strlower(discard_const_p(char, finfo->name));
        }
        
-       if (!directory_exist(finfo->name,NULL) && 
+       if (!directory_exist(finfo->name) && 
            mkdir(finfo->name,0777) != 0) {
                d_printf("failed to create directory %s\n",finfo->name);
                pstrcpy(cur_dir,saved_curdir);
@@ -1301,15 +1301,11 @@ static int cmd_put(const char **cmd_ptr)
        
        dos_clean_name(rname);
 
-       {
-               struct stat st;
-               /* allow '-' to represent stdin
-                  jdblair, 24.jun.98 */
-               if (!file_exist(lname,&st) &&
-                   (strcmp(lname,"-"))) {
-                       d_printf("%s does not exist\n",lname);
-                       return 1;
-               }
+       /* allow '-' to represent stdin
+          jdblair, 24.jun.98 */
+       if (!file_exist(lname) && (strcmp(lname,"-"))) {
+               d_printf("%s does not exist\n",lname);
+               return 1;
        }
 
        return do_put(rname, lname, False);
@@ -2479,7 +2475,6 @@ static int cmd_reput(const char **cmd_ptr)
        pstring remote_name;
        fstring buf;
        char *p = buf;
-       struct stat st;
        
        pstrcpy(remote_name, cur_dir);
        pstrcat(remote_name, "\\");
@@ -2490,7 +2485,7 @@ static int cmd_reput(const char **cmd_ptr)
        }
        pstrcpy(local_name, p);
   
-       if (!file_exist(local_name, &st)) {
+       if (!file_exist(local_name)) {
                d_printf("%s does not exist\n", local_name);
                return 1;
        }
index e18fb311aac52623aa7c02c8fd109d4ed2fd7870..7f73807ec6b1262324983342e3d72dd11520d42c 100644 (file)
@@ -496,7 +496,7 @@ static void init_mount(void)
 
                asprintf(&smbmnt_path, "%s/smbmnt", dyn_BINDIR);
                
-               if (file_exist(smbmnt_path, NULL)) {
+               if (file_exist(smbmnt_path)) {
                        execv(smbmnt_path, args);
                        fprintf(stderr,
                                "smbfs/init_mount: execv of %s failed. Error was %s.",
index af41a20aa57a8bb3a2418033cf7bb68313e879be..d95924670f6facdbe0b640296fb7001e761d4dfb 100644 (file)
@@ -44,16 +44,15 @@ const char *tmpdir(void)
 /*******************************************************************
  Check if a file exists - call vfs_file_exist for samba files.
 ********************************************************************/
-BOOL file_exist(const char *fname, struct stat *sbuf)
+BOOL file_exist(const char *fname)
 {
        struct stat st;
-       if (!sbuf)
-               sbuf = &st;
-  
-       if (stat(fname,sbuf) != 0) 
-               return(False);
 
-       return((S_ISREG(sbuf->st_mode)) || (S_ISFIFO(sbuf->st_mode)));
+       if (stat(fname, &st) != 0) {
+               return False;
+       }
+
+       return ((S_ISREG(st.st_mode)) || (S_ISFIFO(st.st_mode)));
 }
 
 /*******************************************************************
@@ -74,18 +73,16 @@ time_t file_modtime(const char *fname)
  Check if a directory exists.
 ********************************************************************/
 
-BOOL directory_exist(const char *dname,struct stat *st)
+BOOL directory_exist(const char *dname)
 {
-       struct stat st2;
+       struct stat st;
        BOOL ret;
 
-       if (!st)
-               st = &st2;
-
-       if (stat(dname,st) != 0) 
-               return(False);
+       if (stat(dname,&st) != 0) {
+               return False;
+       }
 
-       ret = S_ISDIR(st->st_mode);
+       ret = S_ISDIR(st.st_mode);
        if(!ret)
                errno = ENOTDIR;
        return ret;
@@ -687,7 +684,7 @@ char *lock_path(TALLOC_CTX* mem_ctx, const char *name)
        dname = talloc_strdup(mem_ctx, lp_lockdir());
        trim_string(dname,"","/");
        
-       if (!directory_exist(dname,NULL)) {
+       if (!directory_exist(dname)) {
                mkdir(dname,0755);
        }
        
@@ -738,7 +735,7 @@ char *smbd_tmp_path(TALLOC_CTX *mem_ctx, const char *name)
        char *fname, *dname;
 
        dname = lock_path(mem_ctx, "smbd.tmp");
-       if (!directory_exist(dname,NULL)) {
+       if (!directory_exist(dname)) {
                mkdir(dname,0755);
        }
 
index ac15a62e5423e1491a3576f92e37b1e60aef377b..3697d2f181be9c4c1e662ad4b02fe2fe64632873 100644 (file)
@@ -1338,7 +1338,7 @@ void dcerpc_log_packet(const struct dcerpc_interface_table *ndr,
                if (name == NULL) {
                        return;
                }
-               if (!file_exist(name, NULL)) {
+               if (!file_exist(name)) {
                        if (file_save(name, pkt->data, pkt->length)) {
                                DEBUG(10,("Logged rpc packet to %s\n", name));
                        }
index 3f6e205e71e8264244aa6d1dc480b4aef93c77e4..ac5cf69e9a6f60a51a3e07572330c05782f5d080 100644 (file)
@@ -182,13 +182,3 @@ uint16_t svfs_unix_to_dos_attrib(mode_t mode)
        return ret;
 }
 
-/*
-  build a file_id from a stat struct
-*/
-uint64_t svfs_file_id(struct stat *st)
-{
-       uint64_t ret = st->st_ino;
-       ret <<= 32;
-       ret |= st->st_dev;
-       return ret;
-}
index 6f634efd534cb7c7a2985b7d0699071cefcf1c40..cebf7a5c327fcf16a5386d16155c982850742bdf 100644 (file)
@@ -172,6 +172,17 @@ static NTSTATUS svfs_chkpath(struct ntvfs_module_context *ntvfs,
        return NT_STATUS_OK;
 }
 
+/*
+  build a file_id from a stat struct
+*/
+static uint64_t svfs_file_id(struct stat *st)
+{
+       uint64_t ret = st->st_ino;
+       ret <<= 32;
+       ret |= st->st_dev;
+       return ret;
+}
+
 /*
   approximately map a struct stat to a generic fileinfo struct
 */
index 288bc3a38e369a4ca7c0c95897a36f45d5ad9100..121821b54234e0b987c244fe3707f7fd9855e25d 100644 (file)
@@ -2028,7 +2028,7 @@ static BOOL handle_include(const char *pszParmValue, char **ptr)
 
        string_set(ptr, fname);
 
-       if (file_exist(fname, NULL))
+       if (file_exist(fname))
                return (pm_process(fname, do_section, do_parameter));
 
        DEBUG(2, ("Can't find include file %s\n", fname));
index fb1ed56f4d892ac7bfac8040dae85cd3ea1d2bad..48537375d56b753a6a1d3e9557ce3f6dd44900e5 100644 (file)
@@ -269,7 +269,7 @@ NTSTATUS dcesrv_sock_init(struct dcesrv_context *dce_ctx,
        NTSTATUS status;
 
        /* Make sure the directory for NCALRPC exists */
-       if (!directory_exist(lp_ncalrpc_dir(), NULL)) {
+       if (!directory_exist(lp_ncalrpc_dir())) {
                mkdir(lp_ncalrpc_dir(), 0755);
        }
 
index 9bf71702f23880f73caa6772304dcb1cfe4a206d..c5dee5f7ad363602411b51836290bc6e0c8d9e61 100644 (file)
@@ -157,7 +157,7 @@ static int binary_smbd_main(int argc, const char *argv[])
 
        cleanup_tmp_files();
 
-       if (!directory_exist(lp_lockdir(), NULL)) {
+       if (!directory_exist(lp_lockdir())) {
                mkdir(lp_lockdir(), 0755);
        }
 
index c277772e1e56f8da7720b4c2c682b0928151fe72..0513b1b1256ab93538928694e6a20964cc41b98b 100644 (file)
@@ -153,7 +153,7 @@ static void winbind_task_init(struct task_server *task)
        }
 
        /* Make sure the directory for NCALRPC exists */
-       if (!directory_exist(WINBINDD_DIR, NULL)) {
+       if (!directory_exist(WINBINDD_DIR)) {
                mkdir(WINBINDD_DIR, 0755);
        }