svn commit: samba r10588 - in branches/SAMBA_4_0/source: include lib/registry/tools param smb_server

jelmer at samba.org jelmer at samba.org
Wed Sep 28 19:56:23 GMT 2005


Author: jelmer
Date: 2005-09-28 19:56:21 +0000 (Wed, 28 Sep 2005)
New Revision: 10588

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

Log:
Remove more unused files, macros

Removed:
   branches/SAMBA_4_0/source/include/clitar.h
   branches/SAMBA_4_0/source/include/interfaces.h
   branches/SAMBA_4_0/source/include/module.h
Modified:
   branches/SAMBA_4_0/source/include/includes.h
   branches/SAMBA_4_0/source/include/mutex.h
   branches/SAMBA_4_0/source/include/smb_macros.h
   branches/SAMBA_4_0/source/lib/registry/tools/regpatch.c
   branches/SAMBA_4_0/source/param/loadparm.c
   branches/SAMBA_4_0/source/smb_server/trans2.c


Changeset:
Deleted: branches/SAMBA_4_0/source/include/clitar.h
===================================================================
--- branches/SAMBA_4_0/source/include/clitar.h	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/include/clitar.h	2005-09-28 19:56:21 UTC (rev 10588)
@@ -1,41 +0,0 @@
-/*
- * Unix SMB/CIFS implementation. 
- * clitar file format
- * Copyright (C) Andrew Tridgell              2000
- * 
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 675
- * Mass Ave, Cambridge, MA 02139, USA.  
- */
-
-#ifndef _CLITAR_H
-#define _CLITAR_H
-
-#define TBLOCK 512
-#define NAMSIZ 100
-union hblock {
-  char dummy[TBLOCK];
-  struct header {
-    char name[NAMSIZ];
-    char mode[8];
-    char uid[8];
-    char gid[8];
-    char size[12];
-    char mtime[12];
-    char chksum[8];
-    char linkflag;
-    char linkname[NAMSIZ];
-  } dbuf;
-};
-
-#endif /* _CLITAR_H */

Modified: branches/SAMBA_4_0/source/include/includes.h
===================================================================
--- branches/SAMBA_4_0/source/include/includes.h	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/include/includes.h	2005-09-28 19:56:21 UTC (rev 10588)
@@ -102,7 +102,6 @@
 #include "smb_macros.h"
 #include "smb.h"
 #include "byteorder.h"
-#include "module.h"
 #include "lib/tdr/tdr.h"
 #include "librpc/ndr/libndr.h"
 #include "librpc/gen_ndr/misc.h"
@@ -116,10 +115,6 @@
 #include "lib/com/com.h"
 #include "credentials.h"
 
-#define malloc_p(type) (type *)malloc(sizeof(type))
-#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
-#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
-
 /***** automatically generated prototypes *****/
 #define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
 #include "include/proto.h"
@@ -170,9 +165,4 @@
 #define UINT16_MAX 65535
 #endif
 
-/*
-  type safe varient of smb_xmalloc()
-*/
-#define smb_xmalloc_p(type) (type *)smb_xmalloc(sizeof(type))
-
 #endif /* _INCLUDES_H */

Deleted: branches/SAMBA_4_0/source/include/interfaces.h
===================================================================

Deleted: branches/SAMBA_4_0/source/include/module.h
===================================================================
--- branches/SAMBA_4_0/source/include/module.h	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/include/module.h	2005-09-28 19:56:21 UTC (rev 10588)
@@ -1,30 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   Handling of idle/exit events
-   Copyright (C) Jelmer Vernooij 2003
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef _MODULE_H
-#define _MODULE_H
-
-/* Module support */
-typedef NTSTATUS (*init_module_function) (void);
-
-/* Module that registers a backend for a certain subsystem */
-typedef NTSTATUS (*register_backend_function) (const void *data);
-
-#endif /* _MODULE_H */

Modified: branches/SAMBA_4_0/source/include/mutex.h
===================================================================
--- branches/SAMBA_4_0/source/include/mutex.h	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/include/mutex.h	2005-09-28 19:56:21 UTC (rev 10588)
@@ -66,4 +66,4 @@
 	int (*rwlock_destroy)(smb_rwlock_t *rwlock, const char *name);
 };
 
-#endif /* ndef _MUTEX_H_ */
+#endif /* endif _MUTEX_H_ */

Modified: branches/SAMBA_4_0/source/include/smb_macros.h
===================================================================
--- branches/SAMBA_4_0/source/include/smb_macros.h	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/include/smb_macros.h	2005-09-28 19:56:21 UTC (rev 10588)
@@ -70,4 +70,8 @@
 #define SAFE_FREE(x) do { if ((x) != NULL) {free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
 #endif
 
+#define malloc_p(type) (type *)malloc(sizeof(type))
+#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
+#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
+
 #endif /* _SMB_MACROS_H */

Modified: branches/SAMBA_4_0/source/lib/registry/tools/regpatch.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tools/regpatch.c	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/lib/registry/tools/regpatch.c	2005-09-28 19:56:21 UTC (rev 10588)
@@ -156,10 +156,13 @@
  */
 static struct cmd_line *get_cmd_line(int fd)
 {
-  CMD_LINE *cl = smb_xmalloc_p(CMD_LINE);
+  CMD_LINE *cl = malloc_p(CMD_LINE);
   int i = 0, rc;
   uint8_t ch;
 
+  if (!cl)
+	  return NULL;
+
   cl->len = INIT_ALLOC;
 
   /*
@@ -447,7 +450,9 @@
   struct cmd_line *cl = NULL;
   struct val_spec_list *vl = NULL;
 
-  cmd = smb_xmalloc_p(struct command_s);
+  cmd = malloc_p(struct command_s);
+  if (!cmd)
+	  return NULL;
 
   cmd->cmd = CMD_NONE;
   cmd->key = NULL;
@@ -490,7 +495,9 @@
 	 * There could be a \ on the end which we need to 
 	 * handle at some time
 	 */
-	vl = smb_xmalloc_p(struct val_spec_list);
+	vl = malloc_p(struct val_spec_list);
+	if (!vl)
+		return NULL;
 	vl->next = NULL;
 	vl->val = NULL;
 	vl->name = parse_value(cl, &vl->type, &vl->val);
@@ -609,7 +616,9 @@
     return NULL;
   }
 
-  tmp = smb_xmalloc_p(CMD_FILE); 
+  tmp = malloc_p(CMD_FILE); 
+  if (!tmp)
+	  return NULL;
 
   /*
    * Let's fill in some of the fields;

Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/param/loadparm.c	2005-09-28 19:56:21 UTC (rev 10588)
@@ -1485,7 +1485,9 @@
 			pdata = pdata->next;
 		}
 		if (not_added) {
-			paramo = smb_xmalloc_p(struct param_opt);
+			paramo = malloc_p(struct param_opt);
+			if (!paramo)
+				smb_panic("OOM");
 			paramo->key = strdup(data->key);
 			paramo->value = strdup(data->value);
 			DLIST_ADD(pserviceDest->param_opt, paramo);
@@ -1742,7 +1744,9 @@
 		}
 	}
 
-	paramo = smb_xmalloc_p(struct param_opt);
+	paramo = malloc_p(struct param_opt);
+	if (!paramo)
+		smb_panic("OOM");
 	paramo->key = strdup(name);
 	paramo->value = strdup(pszParmValue);
 	paramo->flags = flags;

Modified: branches/SAMBA_4_0/source/smb_server/trans2.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/trans2.c	2005-09-28 18:47:06 UTC (rev 10587)
+++ branches/SAMBA_4_0/source/smb_server/trans2.c	2005-09-28 19:56:21 UTC (rev 10588)
@@ -26,8 +26,6 @@
 #include "smb_server/smb_server.h"
 #include "librpc/gen_ndr/ndr_misc.h"
 
-
-
 #define CHECK_MIN_BLOB_SIZE(blob, size) do { \
 	if ((blob)->length < (size)) { \
 		return NT_STATUS_INFO_LENGTH_MISMATCH; \



More information about the samba-cvs mailing list