summaryrefslogtreecommitdiff
path: root/pr/src/md/windows/w32shm.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/src/md/windows/w32shm.c')
-rw-r--r--pr/src/md/windows/w32shm.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/pr/src/md/windows/w32shm.c b/pr/src/md/windows/w32shm.c
index 8e8b1d68..748a9860 100644
--- a/pr/src/md/windows/w32shm.c
+++ b/pr/src/md/windows/w32shm.c
@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include <private/primpl.h>
+#include <private/primpl.h>
#include <string.h>
#include <prshm.h>
#include <prerr.h>
@@ -23,11 +23,11 @@ extern PRLogModuleInfo *_pr_shm_lm;
*/
static DWORD filemapAccessTable[] = {
FILE_MAP_ALL_ACCESS & ~FILE_MAP_WRITE, /* read */
- FILE_MAP_ALL_ACCESS & ~FILE_MAP_READ, /* write */
+ FILE_MAP_ALL_ACCESS & ~FILE_MAP_READ, /* write */
0 /* execute */
};
-extern PRSharedMemory * _MD_OpenSharedMemory(
+extern PRSharedMemory * _MD_OpenSharedMemory(
const char *name,
PRSize size,
PRIntn flags,
@@ -48,15 +48,15 @@ extern PRSharedMemory * _MD_OpenSharedMemory(
if ( PR_FAILURE == rc )
{
PR_SetError(PR_UNKNOWN_ERROR, 0 );
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: name is invalid"));
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: name is invalid"));
return(NULL);
}
shm = PR_NEWZAP( PRSharedMemory );
- if ( NULL == shm )
+ if ( NULL == shm )
{
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0 );
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: New PRSharedMemory out of memory"));
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: New PRSharedMemory out of memory"));
return(NULL);
}
@@ -64,14 +64,14 @@ extern PRSharedMemory * _MD_OpenSharedMemory(
if ( NULL == shm->ipcname )
{
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0 );
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: New shm->ipcname out of memory"));
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: New shm->ipcname out of memory"));
PR_DELETE(shm);
return(NULL);
}
/* copy args to struct */
strcpy( shm->ipcname, ipcname );
- shm->size = size;
+ shm->size = size;
shm->mode = mode;
shm->flags = flags;
shm->ident = _PR_SHM_IDENT;
@@ -118,25 +118,25 @@ extern PRSharedMemory * _MD_OpenSharedMemory(
}
if ( NULL == shm->handle ) {
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
( "PR_OpenSharedMemory: CreateFileMapping() failed: %s",
- shm->ipcname ));
+ shm->ipcname ));
_PR_MD_MAP_DEFAULT_ERROR( GetLastError());
PR_FREEIF( shm->ipcname )
PR_DELETE( shm );
return(NULL);
} else {
if (( flags & PR_SHM_EXCL) && ( GetLastError() == ERROR_ALREADY_EXISTS )) {
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
( "PR_OpenSharedMemory: Request exclusive & already exists",
- shm->ipcname ));
+ shm->ipcname ));
PR_SetError( PR_FILE_EXISTS_ERROR, ERROR_ALREADY_EXISTS );
CloseHandle( shm->handle );
PR_FREEIF( shm->ipcname )
PR_DELETE( shm );
return(NULL);
} else {
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
( "PR_OpenSharedMemory: CreateFileMapping() success: %s, handle: %d",
shm->ipcname, shm->handle ));
return(shm);
@@ -151,16 +151,16 @@ extern PRSharedMemory * _MD_OpenSharedMemory(
#endif
if ( NULL == shm->handle ) {
_PR_MD_MAP_DEFAULT_ERROR( GetLastError());
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
( "PR_OpenSharedMemory: OpenFileMapping() failed: %s, error: %d",
- shm->ipcname, PR_GetOSError()));
+ shm->ipcname, PR_GetOSError()));
PR_FREEIF( shm->ipcname );
PR_DELETE( shm );
return(NULL);
} else {
- PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
+ PR_LOG(_pr_shm_lm, PR_LOG_DEBUG,
( "PR_OpenSharedMemory: OpenFileMapping() success: %s, handle: %d",
- shm->ipcname, shm->handle ));
+ shm->ipcname, shm->handle ));
return(shm);
}
}
@@ -184,7 +184,7 @@ extern void * _MD_AttachSharedMemory( PRSharedMemory *shm, PRIntn flags )
if ( NULL == addr ) {
_PR_MD_MAP_DEFAULT_ERROR( GetLastError());
- PR_LOG( _pr_shm_lm, PR_LOG_ERROR,
+ PR_LOG( _pr_shm_lm, PR_LOG_ERROR,
("_MD_AttachSharedMemory: MapViewOfFile() failed. OSerror: %d", PR_GetOSError()));
}
@@ -200,10 +200,10 @@ extern PRStatus _MD_DetachSharedMemory( PRSharedMemory *shm, void *addr )
PR_ASSERT( shm->ident == _PR_SHM_IDENT );
wrc = UnmapViewOfFile( addr );
- if ( FALSE == wrc )
+ if ( FALSE == wrc )
{
_PR_MD_MAP_DEFAULT_ERROR( GetLastError());
- PR_LOG( _pr_shm_lm, PR_LOG_ERROR,
+ PR_LOG( _pr_shm_lm, PR_LOG_ERROR,
("_MD_DetachSharedMemory: UnmapViewOfFile() failed. OSerror: %d", PR_GetOSError()));
rc = PR_FAILURE;
}
@@ -223,7 +223,7 @@ extern PRStatus _MD_CloseSharedMemory( PRSharedMemory *shm )
if ( FALSE == wrc )
{
_PR_MD_MAP_DEFAULT_ERROR( GetLastError());
- PR_LOG( _pr_shm_lm, PR_LOG_ERROR,
+ PR_LOG( _pr_shm_lm, PR_LOG_ERROR,
("_MD_CloseSharedMemory: CloseHandle() failed. OSerror: %d", PR_GetOSError()));
rc = PR_FAILURE;
}
@@ -236,7 +236,7 @@ extern PRStatus _MD_CloseSharedMemory( PRSharedMemory *shm )
extern PRStatus _MD_DeleteSharedMemory( const char *name )
{
return( PR_SUCCESS );
-}
+}
/*
@@ -244,7 +244,7 @@ extern PRStatus _MD_DeleteSharedMemory( const char *name )
*/
extern PRLogModuleInfo *_pr_shma_lm;
-extern PRFileMap* _md_OpenAnonFileMap(
+extern PRFileMap* _md_OpenAnonFileMap(
const char *dirName,
PRSize size,
PRFileMapProtect prot
@@ -280,7 +280,7 @@ extern PRFileMap* _md_OpenAnonFileMap(
CloseHandle(fm->md.hFileMap);
fm->md.hFileMap = hFileMap;
-Finished:
+Finished:
return(fm);
} /* end md_OpenAnonFileMap() */
@@ -302,7 +302,7 @@ extern PRStatus _md_ExportFileMapAsString(
PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
("_md_ExportFileMapAsString(): prot: %x, hFileMap: %x, dwAccess: %x",
fm->prot, fm->md.hFileMap, fm->md.dwAccess ));
-
+
return((written == -1)? PR_FAILURE : PR_SUCCESS);
} /* end _md_ExportFileMapAsString() */
@@ -342,6 +342,6 @@ extern PRFileMap * _md_ImportFileMapFromString(
} /* end _md_ImportFileMapFromString() */
#else
-Error! Why is PR_HAVE_WIN32_NAMED_SHARED_MEMORY not defined?
+Error! Why is PR_HAVE_WIN32_NAMED_SHARED_MEMORY not defined?
#endif /* PR_HAVE_WIN32_NAMED_SHARED_MEMORY */
/* --- end w32shm.c --- */