svn commit: samba r5302 - in branches/SAMBA_4_0/source: client lib
librpc/rpc ntvfs/simple param rpc_server smbd winbind
tridge at samba.org
tridge at samba.org
Thu Feb 10 06:36:31 GMT 2005
Author: tridge
Date: 2005-02-10 06:36:30 +0000 (Thu, 10 Feb 2005)
New Revision: 5302
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5302
Log:
fixed a compilation problem on solaris caused by the recent include
changes
Modified:
branches/SAMBA_4_0/source/client/client.c
branches/SAMBA_4_0/source/client/smbmount.c
branches/SAMBA_4_0/source/lib/util.c
branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
branches/SAMBA_4_0/source/ntvfs/simple/svfs_util.c
branches/SAMBA_4_0/source/ntvfs/simple/vfs_simple.c
branches/SAMBA_4_0/source/param/loadparm.c
branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c
branches/SAMBA_4_0/source/smbd/server.c
branches/SAMBA_4_0/source/winbind/wb_server.c
Changeset:
Modified: branches/SAMBA_4_0/source/client/client.c
===================================================================
--- branches/SAMBA_4_0/source/client/client.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/client/client.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -929,7 +929,7 @@
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 @@
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 @@
pstring remote_name;
fstring buf;
char *p = buf;
- struct stat st;
pstrcpy(remote_name, cur_dir);
pstrcat(remote_name, "\\");
@@ -2490,7 +2485,7 @@
}
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;
}
Modified: branches/SAMBA_4_0/source/client/smbmount.c
===================================================================
--- branches/SAMBA_4_0/source/client/smbmount.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/client/smbmount.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -496,7 +496,7 @@
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.",
Modified: branches/SAMBA_4_0/source/lib/util.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/lib/util.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -44,16 +44,15 @@
/*******************************************************************
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 @@
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 @@
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 *fname, *dname;
dname = lock_path(mem_ctx, "smbd.tmp");
- if (!directory_exist(dname,NULL)) {
+ if (!directory_exist(dname)) {
mkdir(dname,0755);
}
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -1338,7 +1338,7 @@
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));
}
Modified: branches/SAMBA_4_0/source/ntvfs/simple/svfs_util.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/simple/svfs_util.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/ntvfs/simple/svfs_util.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -182,13 +182,3 @@
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;
-}
Modified: branches/SAMBA_4_0/source/ntvfs/simple/vfs_simple.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/simple/vfs_simple.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/ntvfs/simple/vfs_simple.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -173,6 +173,17 @@
}
/*
+ 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
*/
static NTSTATUS svfs_map_fileinfo(struct ntvfs_module_context *ntvfs,
Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/param/loadparm.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -2028,7 +2028,7 @@
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));
Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -269,7 +269,7 @@
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);
}
Modified: branches/SAMBA_4_0/source/smbd/server.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/server.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/smbd/server.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -157,7 +157,7 @@
cleanup_tmp_files();
- if (!directory_exist(lp_lockdir(), NULL)) {
+ if (!directory_exist(lp_lockdir())) {
mkdir(lp_lockdir(), 0755);
}
Modified: branches/SAMBA_4_0/source/winbind/wb_server.c
===================================================================
--- branches/SAMBA_4_0/source/winbind/wb_server.c 2005-02-10 05:29:38 UTC (rev 5301)
+++ branches/SAMBA_4_0/source/winbind/wb_server.c 2005-02-10 06:36:30 UTC (rev 5302)
@@ -153,7 +153,7 @@
}
/* Make sure the directory for NCALRPC exists */
- if (!directory_exist(WINBINDD_DIR, NULL)) {
+ if (!directory_exist(WINBINDD_DIR)) {
mkdir(WINBINDD_DIR, 0755);
}
More information about the samba-cvs
mailing list