summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/src/md/unix/uxshm.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsprpub/pr/src/md/unix/uxshm.c')
-rw-r--r--nsprpub/pr/src/md/unix/uxshm.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/nsprpub/pr/src/md/unix/uxshm.c b/nsprpub/pr/src/md/unix/uxshm.c
index dec4e3a7a..54e68191c 100644
--- a/nsprpub/pr/src/md/unix/uxshm.c
+++ b/nsprpub/pr/src/md/unix/uxshm.c
@@ -76,8 +76,8 @@ extern PRSharedMemory * _MD_OpenSharedMemory(
/* copy args to struct */
strcpy( shm->ipcname, ipcname );
- shm->size = size;
- shm->mode = mode;
+ shm->size = size;
+ shm->mode = mode;
shm->flags = flags;
shm->ident = _PR_SHM_IDENT;
@@ -500,30 +500,32 @@ extern PRFileMap* _md_OpenAnonFileMap(
("_md_OpenAnonFileMap(): PR_snprintf(): failed, generating filename"));
goto Finished;
}
-
+
/* create the file */
- osfd = open( genName, (O_CREAT | O_EXCL | O_RDWR), mode );
- if ( -1 == osfd ) {
- if ( EEXIST == errno ) {
- PR_smprintf_free( genName );
- continue; /* name exists, try again */
- } else {
- _PR_MD_MAP_OPEN_ERROR( errno );
- PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
- ("_md_OpenAnonFileMap(): open(): failed, filename: %s, errno: %d",
- genName, PR_GetOSError()));
- PR_smprintf_free( genName );
- goto Finished;
- }
+ osfd = open(genName, (O_CREAT | O_EXCL | O_RDWR), mode);
+ if (-1 == osfd) {
+ if (EEXIST == errno) {
+ PR_smprintf_free(genName);
+ continue; /* name exists, try again */
+ }
+ _PR_MD_MAP_OPEN_ERROR(errno);
+ PR_LOG(
+ _pr_shma_lm,
+ PR_LOG_DEBUG,
+ ("_md_OpenAnonFileMap(): open(): failed, filename: %s, errno: %d",
+ genName,
+ PR_GetOSError()));
+ PR_smprintf_free(genName);
+ goto Finished;
}
break; /* name generation and open successful, break; */
} /* end for() */
- if ( incr == maxTries ) {
- PR_ASSERT( -1 == osfd );
- PR_ASSERT( EEXIST == errno );
- _PR_MD_MAP_OPEN_ERROR( errno );
- goto Finished;
+ if (incr == maxTries) {
+ PR_ASSERT(-1 == osfd);
+ PR_ASSERT(EEXIST == errno);
+ _PR_MD_MAP_OPEN_ERROR(errno);
+ goto Finished;
}
urc = unlink( genName );