svn commit: samba r7200 - in branches/SAMBA_3_0/source: include printing smbd

jra at samba.org jra at samba.org
Thu Jun 2 23:18:54 GMT 2005


Author: jra
Date: 2005-06-02 23:18:52 +0000 (Thu, 02 Jun 2005)
New Revision: 7200

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7200

Log:
Don't use memset, use SET_STAT_INVALID (has the same effect).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/include/smb_macros.h
   branches/SAMBA_3_0/source/printing/nt_printing.c
   branches/SAMBA_3_0/source/smbd/dir.c
   branches/SAMBA_3_0/source/smbd/filename.c
   branches/SAMBA_3_0/source/smbd/notify_hash.c
   branches/SAMBA_3_0/source/smbd/service.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/smb_macros.h
===================================================================
--- branches/SAMBA_3_0/source/include/smb_macros.h	2005-06-02 20:42:38 UTC (rev 7199)
+++ branches/SAMBA_3_0/source/include/smb_macros.h	2005-06-02 23:18:52 UTC (rev 7200)
@@ -143,6 +143,7 @@
 
 #define VALID_STAT(st) ((st).st_nlink != 0)  
 #define VALID_STAT_OF_DIR(st) (VALID_STAT(st) && S_ISDIR((st).st_mode))
+#define SET_STAT_INVALID(st) ((st).st_nlink = 0)
 
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))

Modified: branches/SAMBA_3_0/source/printing/nt_printing.c
===================================================================
--- branches/SAMBA_3_0/source/printing/nt_printing.c	2005-06-02 20:42:38 UTC (rev 7199)
+++ branches/SAMBA_3_0/source/printing/nt_printing.c	2005-06-02 23:18:52 UTC (rev 7200)
@@ -1152,8 +1152,8 @@
 	SMB_STRUCT_STAT stat_buf;
 	BOOL bad_path;
 
-	ZERO_STRUCT(st);
-	ZERO_STRUCT(stat_buf);
+	SET_STAT_INVALID(st);
+	SET_STAT_INVALID(stat_buf);
 	new_create_time = (time_t)0;
 	old_create_time = (time_t)0;
 
@@ -1265,7 +1265,7 @@
 	SMB_STRUCT_STAT   st;
 	connection_struct *conn;
 
-	ZERO_STRUCT(st);
+	SET_STAT_INVALID(st);
 
 	*perr = WERR_INVALID_PARAM;
 

Modified: branches/SAMBA_3_0/source/smbd/dir.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/dir.c	2005-06-02 20:42:38 UTC (rev 7199)
+++ branches/SAMBA_3_0/source/smbd/dir.c	2005-06-02 23:18:52 UTC (rev 7200)
@@ -560,7 +560,7 @@
 {
 	pstring pathreal;
 
-	ZERO_STRUCTP(pst);
+	SET_STAT_INVALID(pst);
 
 	if (dptr->has_wild) {
 		return dptr_normal_ReadDirName(dptr, poffset, pst);
@@ -629,7 +629,7 @@
 
 BOOL dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst)
 {
-	ZERO_STRUCTP(pst);
+	SET_STAT_INVALID(pst);
 
 	if (!dptr->has_wild && (dptr->dir_hnd->offset == -1)) {
 		/* This is a singleton directory and we're already at the end. */
@@ -958,7 +958,7 @@
 	BOOL hide_unwriteable = lp_hideunwriteable_files(SNUM(conn));
 	BOOL hide_special = lp_hide_special_files(SNUM(conn));
 
-	ZERO_STRUCTP(pst);
+	SET_STAT_INVALID(pst);
 
 	if ((strcmp(".",name) == 0) || (strcmp("..",name) == 0)) {
 		return True; /* . and .. are always visible. */

Modified: branches/SAMBA_3_0/source/smbd/filename.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/filename.c	2005-06-02 20:42:38 UTC (rev 7199)
+++ branches/SAMBA_3_0/source/smbd/filename.c	2005-06-02 23:18:52 UTC (rev 7200)
@@ -92,7 +92,7 @@
 	BOOL component_was_mangled = False;
 	BOOL name_has_wildcard = False;
 
-	ZERO_STRUCTP(pst);
+	SET_STAT_INVALID(pst);
 
 	*dirpath = 0;
 	*bad_path = False;
@@ -258,7 +258,7 @@
 			pstring rest;
 
 			/* Stat failed - ensure we don't use it. */
-			ZERO_STRUCT(st);
+			SET_STAT_INVALID(st);
 			*rest = 0;
 
 			/*
@@ -346,7 +346,7 @@
 				if (SMB_VFS_STAT(conn,name, &st) == 0) {
 					*pst = st;
 				} else {
-					ZERO_STRUCT(st);
+					SET_STAT_INVALID(st);
 				}
 			}
 		} /* end else */

Modified: branches/SAMBA_3_0/source/smbd/notify_hash.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/notify_hash.c	2005-06-02 20:42:38 UTC (rev 7199)
+++ branches/SAMBA_3_0/source/smbd/notify_hash.c	2005-06-02 23:18:52 UTC (rev 7200)
@@ -91,7 +91,7 @@
 	
 	offset = 0;
 	while ((fname = ReadDirName(dp, &offset))) {
-		ZERO_STRUCT(st);
+		SET_STAT_INVALID(st);
 		if(strequal(fname, ".") || strequal(fname, ".."))
 			continue;		
 

Modified: branches/SAMBA_3_0/source/smbd/service.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/service.c	2005-06-02 20:42:38 UTC (rev 7199)
+++ branches/SAMBA_3_0/source/smbd/service.c	2005-06-02 23:18:52 UTC (rev 7200)
@@ -275,7 +275,7 @@
 
 	*user = 0;
 	fstrcpy(dev, pdev);
-	ZERO_STRUCT(st);
+	SET_STAT_INVALD(st);
 
 	if (NT_STATUS_IS_ERR(*status = share_sanity_checks(snum, dev))) {
 		return NULL;



More information about the samba-cvs mailing list