fixup commit for tag 'ANGELON_MOZ_14_20030709_TAG' ANGELON_MOZ12_N6_BRANCH ANGELON_MOZ_14_20030709_TAG
authorcvs2hg
Fri, 18 Apr 2003 20:13:49 +0000
branchANGELON_MOZ12_N6_BRANCH
changeset 4363 416a9100fcdb4b9762fcacf0271499ce4db350d2
parent 4266 2618cfd419d58338a4da5887dffcd8e2d17a5033 (current diff)
parent 4267 3b660c2f5956413a4c79349cd81fa3209e2088a7 (diff)
child 10669 db0248a1cc18216e7a5651f623765c78cdf7f113
push idunknown
push userunknown
push dateunknown
fixup commit for tag 'ANGELON_MOZ_14_20030709_TAG'
dbm/include/mcom_db.h
dbm/src/Makefile.in
dbm/src/hash.c
dbm/src/mktemp.c
dbm/src/ndbm.c
dbm/src/nsres.c
dbm/tests/Makefile.in
--- a/dbm/include/mcom_db.h
+++ b/dbm/include/mcom_db.h
@@ -217,16 +217,24 @@
 #if defined(_WINDOWS) || defined(XP_OS2)
 #include <stdio.h>
 #include <io.h>
 
 #ifndef XP_OS2 
 #define MAXPATHLEN 	1024               
 #endif
 
+#ifdef XP_OS2_VACPP
+#include <os2.h>
+#define	MAXPATHLEN	CCHMAXPATH
+#define	EPERM		EINVAL
+#define	ENOTDIR		EBADPOS
+#define	S_ISDIR(s)	((s) & S_IFDIR)
+#endif
+
 #define	EFTYPE		EINVAL		/* POSIX 1003.1 format errno. */
 
 #ifndef	STDERR_FILENO
 #define	STDIN_FILENO	0		/* ANSI C #defines */
 #define	STDOUT_FILENO	1
 #define	STDERR_FILENO	2
 #endif
 
--- a/dbm/src/Makefile.in
+++ b/dbm/src/Makefile.in
@@ -46,33 +46,30 @@ CSRCS		= \
 		ndbm.c \
 		strerror.c \
 		nsres.c \
 		$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 CSRCS		+= memmove.c snprintf.c
 else
-ifeq (,$(filter -DHAVE_MEMMOVE=1,$(DEFS)))
+ifeq (,$(filter -DHAVE_MEMMOVE=1,$(ACDEFINES)))
 CSRCS += memmove.c
 endif
 
-ifeq (,$(filter -DHAVE_SNPRINTF=1,$(DEFS)))
+ifeq (,$(filter -DHAVE_SNPRINTF=1,$(ACDEFINES)))
 CSRCS += snprintf.c
 endif
 endif # WINNT
 
 LOCAL_INCLUDES	= -I$(srcdir)/../include
 
 FORCE_STATIC_LIB = 1
 FORCE_USE_PIC = 1
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES		+= -DMEMMOVE -D__DBINTERFACE_PRIVATE $(SECURITY_FLAG)
-ifeq ($(OS_ARCH), Linux)
-DEFINES         += -D_BSD_SOURCE
-endif
 
 ifeq ($(OS_ARCH),AIX)
 OS_LIBS		+= -lc_r
 endif
 
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -64,21 +64,16 @@ static char sccsid[] = "@(#)hash.c	8.9 (
 
 #if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
 #include <unistd.h>
 #endif
 #if defined(_WIN32) || defined(_WINDOWS) 
 #include <windows.h>
 #endif
 
-#ifdef XP_OS2_VACPP
-#include "types.h"
-#define EPERM SOCEPERM
-#endif
-
 #include <assert.h>
 
 #include "mcom_db.h"
 #include "hash.h"
 #include "page.h"
 
 /*
 #include "extern.h"
@@ -185,17 +180,17 @@ extern DB *
 	 	 * if it exists
 	 	 */
 		new_table = 1;
 	}
 	hashp->file_size = statbuf.st_size;
 
 	if (file) {				 
 
-#if defined(_WIN32) || defined(_WINDOWS) || defined (macintosh)  || defined(XP_OS2_VACPP)
+#if defined(_WIN32) || defined(_WINDOWS) || defined (macintosh)  || defined(XP_OS2)
 		if ((hashp->fp = DBFILE_OPEN(file, flags | O_BINARY, mode)) == -1)
 			RETURN_ERROR(errno, error0);
 #else
  	if ((hashp->fp = open(file, flags, mode)) == -1)
 		RETURN_ERROR(errno, error0);
 	(void)fcntl(hashp->fp, F_SETFD, 1);
 /* We can't use fcntl because of NFS bugs. SIGH */
 #if 0
--- a/dbm/src/mktemp.c
+++ b/dbm/src/mktemp.c
@@ -49,19 +49,17 @@ static char sccsid[] = "@(#)mktemp.c	8.1
 #include <ctype.h>
 #include "mcom_db.h"
 
 #if !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
 #include <unistd.h>
 #endif
 
 #ifdef XP_OS2_VACPP
-#define ENOTDIR EBADPOS
 #include <process.h>
-#include <dirent.h>
 #endif
 
 #ifdef _WINDOWS
 #include <process.h>
 #include "winfile.h"
 #endif
 
 static int _gettemp(char *path, register int *doopen, int extraFlags);
--- a/dbm/src/ndbm.c
+++ b/dbm/src/ndbm.c
@@ -47,20 +47,16 @@ static char sccsid[] = "@(#)ndbm.c	8.4 (
 #if !defined(_WIN32) && !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
 #include <sys/param.h>
 #endif
 
 #if defined(__linux)
 #include <linux/limits.h>
 #endif
 
-#ifdef __OS2__
-#include "dirent.h"
-#endif
-
 #include <stdio.h>
 #include <string.h>
 
 #include "ndbm.h"
 #include "hash.h"
 
 /*
  * Returns:
--- a/dbm/src/nsres.c
+++ b/dbm/src/nsres.c
@@ -74,18 +74,17 @@ int GenKeyData(const char *library, int3
 
 NSRESHANDLE NSResCreateTable(const char *filename, NSRESTHREADINFO *threadinfo)
 {
 	RESHANDLE hres;
 	int flag;
 
 	flag = O_RDWR | O_CREAT;
 
-	hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
-	memset(hres, 0, sizeof(struct RESDATABASE));
+	hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
 
 	if (threadinfo && threadinfo->lock && threadinfo->fn_lock 
 	  && threadinfo->fn_unlock)
 	{
 		hres->threadinfo = (NSRESTHREADINFO *) malloc( sizeof(NSRESTHREADINFO) );
 		hres->threadinfo->lock = threadinfo->lock;
 		hres->threadinfo->fn_lock = threadinfo->fn_lock;
 		hres->threadinfo->fn_unlock = threadinfo->fn_unlock;
@@ -106,18 +105,17 @@ NSRESHANDLE NSResCreateTable(const char 
 
 NSRESHANDLE NSResOpenTable(const char *filename, NSRESTHREADINFO *threadinfo)
 {
 	RESHANDLE hres;
 	int flag;
 
 	flag = O_RDONLY;  /* only open database for reading */
 
-	hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
-	memset(hres, 0, sizeof(struct RESDATABASE));
+	hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
 
 	if (threadinfo && threadinfo->lock && threadinfo->fn_lock 
 	  && threadinfo->fn_unlock)
 	{
 		hres->threadinfo = (NSRESTHREADINFO *) malloc( sizeof(NSRESTHREADINFO) );
 		hres->threadinfo->lock = threadinfo->lock;
 		hres->threadinfo->fn_lock = threadinfo->fn_lock;
 		hres->threadinfo->fn_unlock = threadinfo->fn_unlock;
--- a/dbm/tests/Makefile.in
+++ b/dbm/tests/Makefile.in
@@ -36,11 +36,8 @@ EXTRA_DSO_LIBS	= dbm$(MOZ_BITS)
 else
 EXTRA_DSO_LIBS	= mozdbm_s
 endif
 
 LIBS		= $(EXTRA_DSO_LIBS)
 
 include $(topsrcdir)/config/rules.mk
 
-ifeq ($(OS_ARCH), Linux)
-DEFINES         += -D_BSD_SOURCE
-endif