This commit is contained in:
relyea%netscape.com 2000-09-20 17:07:22 +00:00
Родитель 038e615119
Коммит 9bd5c43fa0
20 изменённых файлов: 502 добавлений и 87 удалений

Просмотреть файл

@ -89,6 +89,7 @@ else
$(NSINSTALL) -L ../../dist include $(DIST)
$(NSINSTALL) -L ../../dist lib $(DIST)
cp $(DIST)/lib/libmozdbm_s.a $(DIST)/lib/libdbm.a
cp $(DIST)/lib/libmozdbm_s.$(LIB_SUFFIX) $(DIST)/lib/libdbm.$(LIB_SUFFIX)
endif
nsm:: all

Просмотреть файл

@ -100,34 +100,34 @@ US_FLAGS = -DEXPORT_VERSION
EXPORT_FLAGS = -DEXPORT_VERSION
BASE_LIBS = \
$(DIST)/lib/libdbm.a \
$(DIST)/lib/libxp.a \
$(DIST)/lib/libnspr.a \
$(DIST)/lib/libdbm.$(LIB_SUFFIX) \
$(DIST)/lib/libxp.$(LIB_SUFFIX) \
$(DIST)/lib/libnspr.$(LIB_SUFFIX) \
$(NULL)
# $(DIST)/lib/libpurenspr.a \
# $(DIST)/lib/libpurenspr.$(LIB_SUFFIX) \
#There is a circular dependancy in security/lib, and here is a gross fix
SEC_LIBS = \
$(DIST)/lib/libsecnav.a \
$(DIST)/lib/libssl.a \
$(DIST)/lib/libpkcs7.a \
$(DIST)/lib/libcert.a \
$(DIST)/lib/libkey.a \
$(DIST)/lib/libsecmod.a \
$(DIST)/lib/libcrypto.a \
$(DIST)/lib/libsecutil.a \
$(DIST)/lib/libssl.a \
$(DIST)/lib/libpkcs7.a \
$(DIST)/lib/libcert.a \
$(DIST)/lib/libkey.a \
$(DIST)/lib/libsecmod.a \
$(DIST)/lib/libcrypto.a \
$(DIST)/lib/libsecutil.a \
$(DIST)/lib/libhash.a \
$(DIST)/lib/libsecnav.$(LIB_SUFFIX) \
$(DIST)/lib/libssl.$(LIB_SUFFIX) \
$(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
$(DIST)/lib/libcert.$(LIB_SUFFIX) \
$(DIST)/lib/libkey.$(LIB_SUFFIX) \
$(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
$(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
$(DIST)/lib/libssl.$(LIB_SUFFIX) \
$(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
$(DIST)/lib/libcert.$(LIB_SUFFIX) \
$(DIST)/lib/libkey.$(LIB_SUFFIX) \
$(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
$(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
$(DIST)/lib/libhash.$(LIB_SUFFIX) \
$(NULL)
MYLIB = lib/$(OBJDIR)/libsectool.a
MYLIB = lib/$(OBJDIR)/libsectool.$(LIB_SUFFIX)
US_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)
EX_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)

Просмотреть файл

@ -41,7 +41,7 @@
#include <termios.h>
#endif
#if defined(XP_WIN)
#if defined(XP_WIN) || defined (XP_PC)
#include <time.h>
#include <conio.h>
#endif

Просмотреть файл

@ -67,7 +67,7 @@ endif
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS += $(DIST)/lib/crmf.lib
else
EXTRA_LIBS += $(DIST)/lib/libcrmf.a
EXTRA_LIBS += $(DIST)/lib/libcrmf.$(LIB_SUFFIX)
endif
include ../platlibs.mk

Просмотреть файл

@ -66,7 +66,7 @@ endif
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS += $(DIST)/lib/crmf.lib
else
EXTRA_LIBS += $(DIST)/lib/libcrmf.a
EXTRA_LIBS += $(DIST)/lib/libcrmf.$(LIB_SUFFIX)
endif
include ../platlibs.mk

Просмотреть файл

@ -67,8 +67,8 @@ EXTRA_LIBS = \
else
EXTRA_LIBS += \
$(DIST)/lib/libpkcs12.a \
$(DIST)/lib/libpkcs7.a \
$(DIST)/lib/libpkcs12.$(LIB_SUFFIX) \
$(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
$(NULL)
endif

Просмотреть файл

@ -76,33 +76,33 @@ else
# $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
ifdef MOZILLA_SECURITY_BUILD
CRYPTOLIB=$(DIST)/lib/libcrypto.a
CRYPTOLIB=$(DIST)/lib/libcrypto.$(LIB_SUFFIX)
endif
ifdef MOZILLA_BSAFE_BUILD
CRYPTOLIB=$(DIST)/lib/libbsafe.a
CRYPTOLIB=$(DIST)/lib/libbsafe.$(LIB_SUFFIX)
endif
EXTRA_LIBS += \
$(DIST)/lib/libsmime.a \
$(DIST)/lib/libssl.a \
$(DIST)/lib/libjar.a \
$(DIST)/lib/libzlib.a \
$(DIST)/lib/libnss.a \
$(DIST)/lib/libssl.a \
$(DIST)/lib/libsectool.a \
$(DIST)/lib/libpkcs7.a \
$(DIST)/lib/libcerthi.a \
$(DIST)/lib/libpk11wrap.a \
$(DIST)/lib/libcryptohi.a \
$(DIST)/lib/libcerthi.a \
$(DIST)/lib/libpk11wrap.a \
$(DIST)/lib/libsoftoken.a \
$(DIST)/lib/libcertdb.a \
$(DIST)/lib/libswfci.a \
$(DIST)/lib/libfreebl.a \
$(DIST)/lib/libsmime.$(LIB_SUFFIX) \
$(DIST)/lib/libssl.$(LIB_SUFFIX) \
$(DIST)/lib/libjar.$(LIB_SUFFIX) \
$(DIST)/lib/libzlib.$(LIB_SUFFIX) \
$(DIST)/lib/libnss.$(LIB_SUFFIX) \
$(DIST)/lib/libssl.$(LIB_SUFFIX) \
$(DIST)/lib/libsectool.$(LIB_SUFFIX) \
$(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
$(DIST)/lib/libcerthi.$(LIB_SUFFIX) \
$(DIST)/lib/libpk11wrap.$(LIB_SUFFIX) \
$(DIST)/lib/libcryptohi.$(LIB_SUFFIX) \
$(DIST)/lib/libcerthi.$(LIB_SUFFIX) \
$(DIST)/lib/libpk11wrap.$(LIB_SUFFIX) \
$(DIST)/lib/libsoftoken.$(LIB_SUFFIX) \
$(DIST)/lib/libcertdb.$(LIB_SUFFIX) \
$(DIST)/lib/libswfci.$(LIB_SUFFIX) \
$(DIST)/lib/libfreebl.$(LIB_SUFFIX) \
$(CRYPTOLIB) \
$(DIST)/lib/libfreebl.a \
$(DIST)/lib/libsecutil.a \
$(DIST)/lib/libdbm.a \
$(DIST)/lib/libfreebl.$(LIB_SUFFIX) \
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
$(DIST)/lib/libdbm.$(LIB_SUFFIX) \
$(NULL)
# $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)

Просмотреть файл

@ -69,8 +69,8 @@ EXTRA_LIBS = \
else
EXTRA_LIBS += \
$(DIST)/lib/libjar.a \
$(DIST)/lib/libzlib.a \
$(DIST)/lib/libjar.$(LIB_SUFFIX) \
$(DIST)/lib/libzlib.$(LIB_SUFFIX) \
$(NULL)
endif

Просмотреть файл

@ -55,35 +55,35 @@ US_FLAGS = -DEXPORT_VERSION
EXPORT_FLAGS = -DEXPORT_VERSION
BASE_LIBS = \
$(DIST)/lib/libdbm.a \
$(DIST)/lib/libxp.a \
$(DIST)/lib/libnspr.a \
$(DIST)/lib/libdbm.$(LIB_SUFFIX) \
$(DIST)/lib/libxp.$(LIB_SUFFIX) \
$(DIST)/lib/libnspr.$(LIB_SUFFIX) \
$(NULL)
# $(DIST)/lib/libpurenspr.a \
# $(DIST)/lib/libpurenspr.$(LIB_SUFFIX) \
#There are a circular dependancies in security/lib, and we deal with it by
# double linking some libraries
SEC_LIBS = \
$(DIST)/lib/libsecnav.a \
$(DIST)/lib/libssl.a \
$(DIST)/lib/libpkcs7.a \
$(DIST)/lib/libcert.a \
$(DIST)/lib/libkey.a \
$(DIST)/lib/libsecmod.a \
$(DIST)/lib/libcrypto.a \
$(DIST)/lib/libsecutil.a \
$(DIST)/lib/libssl.a \
$(DIST)/lib/libpkcs7.a \
$(DIST)/lib/libcert.a \
$(DIST)/lib/libkey.a \
$(DIST)/lib/libsecmod.a \
$(DIST)/lib/libcrypto.a \
$(DIST)/lib/libsecutil.a \
$(DIST)/lib/libhash.a \
$(DIST)/lib/libsecnav.$(LIB_SUFFIX) \
$(DIST)/lib/libssl.$(LIB_SUFFIX) \
$(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
$(DIST)/lib/libcert.$(LIB_SUFFIX) \
$(DIST)/lib/libkey.$(LIB_SUFFIX) \
$(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
$(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
$(DIST)/lib/libssl.$(LIB_SUFFIX) \
$(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
$(DIST)/lib/libcert.$(LIB_SUFFIX) \
$(DIST)/lib/libkey.$(LIB_SUFFIX) \
$(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
$(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
$(DIST)/lib/libhash.$(LIB_SUFFIX) \
$(NULL)
MYLIB = lib/$(OBJDIR)/libsectool.a
MYLIB = lib/$(OBJDIR)/libsectool.$(LIB_SUFFIX)
US_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)
EX_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)

Просмотреть файл

@ -60,7 +60,7 @@ EXTRA_LIBS = \
else
EXTRA_LIBS += \
../../../lib/fortcrypt/$(OBJDIR)/cilib.a \
../../../lib/fortcrypt/$(OBJDIR)/cilib.$(LIB_SUFFIX) \
$(NULL)
endif

Просмотреть файл

@ -41,7 +41,7 @@
#define NUM_SLOTS 32
#if !defined (XP_UNIX) && !defined (_WINDOWS)
#if !defined (XP_UNIX) && !defined (_WINDOWS) && !defined(XP_OS2)
#define XP_MAC 1 /*Make sure we get this define in for Mac builds*/
#endif

Просмотреть файл

@ -71,22 +71,22 @@ else
#
ifneq ($(OS_ARCH), OSF1)
CRYPTO_LIBS = $(DIST)/lib/libfreebl.a
CRYPTO_LIBS = $(DIST)/lib/libfreebl.$(LIB_SUFFIX)
ifdef MOZILLA_SECURITY_BUILD
CRYPTO_LIBS += $(DIST)/lib/libcrypto.a
CRYPTO_LIBS += $(DIST)/lib/libcrypto.$(LIB_SUFFIX)
endif
ifdef MOZILLA_BSAFE_BUILD
CRYPTO_LIBS += $(DIST)/lib/libbsafe.a
CRYPTO_LIBS += $(DIST)/lib/libbsafe.$(LIB_SUFFIX)
endif
EXTRA_LIBS += \
$(DIST)/lib/libswfci.a \
$(DIST)/lib/libsoftoken.a \
$(DIST)/lib/libswfci.$(LIB_SUFFIX) \
$(DIST)/lib/libsoftoken.$(LIB_SUFFIX) \
$(CRYPTO_LIBS) \
$(DIST)/lib/libsecutil.a \
$(DIST)/lib/libplc4.a \
$(DIST)/lib/libplds4.a \
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
$(DIST)/lib/libplc4.$(LIB_SUFFIX) \
$(DIST)/lib/libplds4.$(LIB_SUFFIX) \
$(NULL)
endif

Просмотреть файл

@ -44,6 +44,9 @@
#include "maci.h"
#include "secport.h"
#include "secrng.h"
#ifdef XP_OS2
#include <stat.h> /* Needed for OS/2 emx */
#endif
#ifdef XP_WIN
#include <windows.h>
@ -395,10 +398,19 @@ fort_GenerateRandom(unsigned char *buf, int bytes)
/*
* NOTE: that MAC is missing below.
*/
#if defined (XP_UNIX) || defined (XP_OS2)
#ifdef XP_UNIX
#define NS_PATH_SEP ':'
#define NS_DIR_SEP '/'
#define NS_DEFAULT_PATH ".:/bin/netscape:/etc/netscape/:/etc"
#endif
#ifdef XP_OS2 /* for OS/2 */
#define NS_PATH_SEP ';'
#define NS_DIR_SEP '\\'
#define NS_DEFAULT_PATH ".:\\bin\\netscape:\\etc\\netscape\\:\\etc"
#endif
PRInt32
local_getFileInfo(const char *fn, PRFileInfo *info)
{
@ -428,7 +440,8 @@ local_getFileInfo(const char *fn, PRFileInfo *info)
}
return rv;
}
#endif
#endif /* UNIX & OS/2 */
#ifdef XP_WIN
#define NS_PATH_SEP ';'
#define NS_DIR_SEP '\\'
@ -609,7 +622,8 @@ local_getFileInfo(const char *fn, PRFileInfo *info)
return 0;
}
#endif
#endif /* XP_WIN */
#ifdef XP_MAC
#error Need to write fort_FindFileInPath for Mac
#define NS_PATH_SEP ','

Просмотреть файл

@ -149,7 +149,7 @@ ifdef MOZILLA_BSAFE_BUILD
ifeq ($(OS_ARCH),WINNT)
libbsafe=bsafe41.lib
else
libbsafe=libbsafe.a
libbsafe=libbsafe.$(LIB_SUFFIX)
endif
private_export::

Просмотреть файл

@ -59,8 +59,12 @@ include config.mk
ifeq ($(OS_ARCH),WINNT)
CSRCS += win32err.c
else
ifeq ($(OS_ARCH),OS2)
CSRCS += os2err.c
else
CSRCS += unix_err.c
endif
endif
#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #

Просмотреть файл

@ -0,0 +1,310 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* This file essentially replicates NSPR's source for the functions that
* map system-specific error codes to NSPR error codes. We would use
* NSPR's functions, instead of duplicating them, but they're private.
* As long as SSL's server session cache code must do platform native I/O
* to accomplish its job, and NSPR's error mapping functions remain private,
* this code will continue to need to be replicated.
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: os2_err.c,v 1.2 2000/09/20 17:07:19 relyea%netscape.com Exp $
*/
#include "prerror.h"
#include "prlog.h"
#include <errno.h>
/*
* Based on win32err.c
* OS2TODO Stub everything for now to build. HCT
*/
/* forward declaration. */
void nss_MD_os2_map_default_error(PRInt32 err);
void nss_MD_os2_map_opendir_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_closedir_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_readdir_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_delete_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
/* The error code for stat() is in errno. */
void nss_MD_os2_map_stat_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_fstat_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_rename_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
/* The error code for access() is in errno. */
void nss_MD_os2_map_access_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_mkdir_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_rmdir_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_read_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_transmitfile_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_write_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_lseek_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_fsync_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
/*
* For both CloseHandle() and closesocket().
*/
void nss_MD_os2_map_close_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_socket_error(PRInt32 err)
{
// PR_ASSERT(err != WSANOTINITIALISED);
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_recv_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_recvfrom_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_send_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAEMSGSIZE: prError = PR_INVALID_ARGUMENT_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_sendto_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAEMSGSIZE: prError = PR_INVALID_ARGUMENT_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_accept_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAEOPNOTSUPP: prError = PR_NOT_TCP_SOCKET_ERROR; break;
// case WSAEINVAL: prError = PR_INVALID_STATE_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_acceptex_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_connect_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAEWOULDBLOCK: prError = PR_IN_PROGRESS_ERROR; break;
// case WSAEINVAL: prError = PR_ALREADY_INITIATED_ERROR; break;
// case WSAETIMEDOUT: prError = PR_IO_TIMEOUT_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_bind_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAEINVAL: prError = PR_SOCKET_ADDRESS_IS_BOUND_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_listen_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAEOPNOTSUPP: prError = PR_NOT_TCP_SOCKET_ERROR; break;
// case WSAEINVAL: prError = PR_INVALID_STATE_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_shutdown_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_getsockname_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAEINVAL: prError = PR_INVALID_STATE_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_getpeername_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_getsockopt_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_setsockopt_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_open_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_gethostname_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
/* Win32 select() only works on sockets. So in this
** context, WSAENOTSOCK is equivalent to EBADF on Unix.
*/
void nss_MD_os2_map_select_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case WSAENOTSOCK: prError = PR_BAD_DESCRIPTOR_ERROR; break;
default: nss_MD_os2_map_default_error(err); return;
}
PR_SetError(prError, err);
}
void nss_MD_os2_map_lockf_error(PRInt32 err)
{
nss_MD_os2_map_default_error(err);
}
void nss_MD_os2_map_default_error(PRInt32 err)
{
PRErrorCode prError;
switch (err) {
// case ENOENT: prError = PR_FILE_NOT_FOUND_ERROR; break;
// case ERROR_ACCESS_DENIED: prError = PR_NO_ACCESS_RIGHTS_ERROR; break;
// case ERROR_ALREADY_EXISTS: prError = PR_FILE_EXISTS_ERROR; break;
// case ERROR_DISK_CORRUPT: prError = PR_IO_ERROR; break;
// case ERROR_DISK_FULL: prError = PR_NO_DEVICE_SPACE_ERROR; break;
// case ERROR_DISK_OPERATION_FAILED: prError = PR_IO_ERROR; break;
// case ERROR_DRIVE_LOCKED: prError = PR_FILE_IS_LOCKED_ERROR; break;
// case ERROR_FILENAME_EXCED_RANGE: prError = PR_NAME_TOO_LONG_ERROR; break;
// case ERROR_FILE_CORRUPT: prError = PR_IO_ERROR; break;
// case ERROR_FILE_EXISTS: prError = PR_FILE_EXISTS_ERROR; break;
// case ERROR_FILE_INVALID: prError = PR_BAD_DESCRIPTOR_ERROR; break;
#if ERROR_FILE_NOT_FOUND != ENOENT
// case ERROR_FILE_NOT_FOUND: prError = PR_FILE_NOT_FOUND_ERROR; break;
#endif
default: prError = PR_UNKNOWN_ERROR; break;
}
PR_SetError(prError, err);
}

Просмотреть файл

@ -0,0 +1,83 @@
/*
* This file essentially replicates NSPR's source for the functions that
* map system-specific error codes to NSPR error codes. We would use
* NSPR's functions, instead of duplicating them, but they're private.
* As long as SSL's server session cache code must do platform native I/O
* to accomplish its job, and NSPR's error mapping functions remain private,
* This code will continue to need to be replicated.
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: os2_err.h,v 1.2 2000/09/20 17:07:20 relyea%netscape.com Exp $
*/
/* NSPR doesn't make these functions public, so we have to duplicate
** them in NSS.
*/
//HCT Based on Win32err.h
extern void nss_MD_os2_map_accept_error(PRInt32 err);
extern void nss_MD_os2_map_acceptex_error(PRInt32 err);
extern void nss_MD_os2_map_access_error(PRInt32 err);
extern void nss_MD_os2_map_bind_error(PRInt32 err);
extern void nss_MD_os2_map_close_error(PRInt32 err);
extern void nss_MD_os2_map_closedir_error(PRInt32 err);
extern void nss_MD_os2_map_connect_error(PRInt32 err);
extern void nss_MD_os2_map_default_error(PRInt32 err);
extern void nss_MD_os2_map_delete_error(PRInt32 err);
extern void nss_MD_os2_map_fstat_error(PRInt32 err);
extern void nss_MD_os2_map_fsync_error(PRInt32 err);
extern void nss_MD_os2_map_gethostname_error(PRInt32 err);
extern void nss_MD_os2_map_getpeername_error(PRInt32 err);
extern void nss_MD_os2_map_getsockname_error(PRInt32 err);
extern void nss_MD_os2_map_getsockopt_error(PRInt32 err);
extern void nss_MD_os2_map_listen_error(PRInt32 err);
extern void nss_MD_os2_map_lockf_error(PRInt32 err);
extern void nss_MD_os2_map_lseek_error(PRInt32 err);
extern void nss_MD_os2_map_mkdir_error(PRInt32 err);
extern void nss_MD_os2_map_open_error(PRInt32 err);
extern void nss_MD_os2_map_opendir_error(PRInt32 err);
extern void nss_MD_os2_map_read_error(PRInt32 err);
extern void nss_MD_os2_map_readdir_error(PRInt32 err);
extern void nss_MD_os2_map_recv_error(PRInt32 err);
extern void nss_MD_os2_map_recvfrom_error(PRInt32 err);
extern void nss_MD_os2_map_rename_error(PRInt32 err);
extern void nss_MD_os2_map_rmdir_error(PRInt32 err);
extern void nss_MD_os2_map_select_error(PRInt32 err);
extern void nss_MD_os2_map_send_error(PRInt32 err);
extern void nss_MD_os2_map_sendto_error(PRInt32 err);
extern void nss_MD_os2_map_setsockopt_error(PRInt32 err);
extern void nss_MD_os2_map_shutdown_error(PRInt32 err);
extern void nss_MD_os2_map_socket_error(PRInt32 err);
extern void nss_MD_os2_map_stat_error(PRInt32 err);
extern void nss_MD_os2_map_transmitfile_error(PRInt32 err);
extern void nss_MD_os2_map_write_error(PRInt32 err);

Просмотреть файл

@ -86,7 +86,7 @@ CSRCS = \
utf8.c \
$(NULL)
ifeq ($(subst /,_,$(shell uname -s)),OS2)
ifeq ($(subst /,,$(shell uname -s)),OS2)
CSRCS += os2_rand.c
endif

Просмотреть файл

@ -36,6 +36,9 @@
#include <os2.h>
#include <secrng.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <stat.h>
static BOOL clockTickTime(unsigned long *phigh, unsigned long *plow)
{

Просмотреть файл

@ -38,7 +38,7 @@
*
* NOTE - These are not public interfaces
*
* $Id: secport.c,v 1.3 2000/05/12 18:43:25 dougt%netscape.com Exp $
* $Id: secport.c,v 1.4 2000/09/20 17:07:22 relyea%netscape.com Exp $
*/
#include "seccomon.h"
@ -58,7 +58,7 @@
#include "prthread.h"
#endif /* THREADMARK */
#if defined(XP_UNIX) || defined(XP_MAC)
#if defined(XP_UNIX) || defined(XP_MAC) || defined(XP_OS2)
#include <stdlib.h>
#else
#include "wtypes.h"