From 770e66f40579be11015aff58858eaee4eed59d2a Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Fri, 6 Sep 2002 01:37:32 +0000 Subject: [PATCH] Bug 166716: do not assert in the unimplemented memory-mapped file functions. It is sufficient for them to fail with the not implemented error. Modified Files: bmmap.c macio.c os2misc.c --- nsprpub/pr/src/md/beos/bmmap.c | 3 +++ nsprpub/pr/src/md/mac/macio.c | 5 ----- nsprpub/pr/src/md/os2/os2misc.c | 5 ----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/nsprpub/pr/src/md/beos/bmmap.c b/nsprpub/pr/src/md/beos/bmmap.c index 2af102ccec8..2775969383a 100644 --- a/nsprpub/pr/src/md/beos/bmmap.c +++ b/nsprpub/pr/src/md/beos/bmmap.c @@ -37,6 +37,7 @@ PR_EXTERN(PRStatus) _PR_MD_CREATE_FILE_MAP(PRFileMap *fmap, PRInt64 size) { + PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 ); return PR_FAILURE; } @@ -57,11 +58,13 @@ _PR_MD_MEM_MAP(PRFileMap *fmap, PRInt64 offset, PRUint32 len) PR_EXTERN(PRStatus) _PR_MD_MEM_UNMAP(void *addr, PRUint32 size) { + PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 ); return PR_FAILURE; } PR_EXTERN(PRStatus) _PR_MD_CLOSE_FILE_MAP(PRFileMap *fmap) { + PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 ); return PR_FAILURE; } diff --git a/nsprpub/pr/src/md/mac/macio.c b/nsprpub/pr/src/md/mac/macio.c index f8448191ad7..f4bb60a493d 100644 --- a/nsprpub/pr/src/md/mac/macio.c +++ b/nsprpub/pr/src/md/mac/macio.c @@ -1908,14 +1908,12 @@ PRStatus _MD_CreateFileMap(PRFileMap *fmap, PRInt64 size) { #pragma unused (fmap, size) - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; } PRInt32 _MD_GetMemMapAlignment(void) { - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return -1; } @@ -1927,7 +1925,6 @@ void * _MD_MemMap( { #pragma unused (fmap, offset, len) - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return NULL; } @@ -1936,7 +1933,6 @@ PRStatus _MD_MemUnmap(void *addr, PRUint32 len) { #pragma unused (addr, len) - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; } @@ -1945,7 +1941,6 @@ PRStatus _MD_CloseFileMap(PRFileMap *fmap) { #pragma unused (fmap) - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; } diff --git a/nsprpub/pr/src/md/os2/os2misc.c b/nsprpub/pr/src/md/os2/os2misc.c index c27b06144f7..250972af0b3 100644 --- a/nsprpub/pr/src/md/os2/os2misc.c +++ b/nsprpub/pr/src/md/os2/os2misc.c @@ -452,14 +452,12 @@ _PR_MD_WAKEUP_CPUS( void ) PRStatus _MD_CreateFileMap(PRFileMap *fmap, PRInt64 size) { - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; } PRInt32 _MD_GetMemMapAlignment(void) { - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return -1; } @@ -469,21 +467,18 @@ void * _MD_MemMap( PROffset64 offset, PRUint32 len) { - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return NULL; } PRStatus _MD_MemUnmap(void *addr, PRUint32 len) { - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; } PRStatus _MD_CloseFileMap(PRFileMap *fmap) { - PR_ASSERT(!"Not implemented"); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; }