summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/src/md/unix/uxshm.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-06 11:40:35 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-06 11:40:35 +0100
commit7c728b3c7680662fc4e92b5d03697b8339560b08 (patch)
tree4a0da02f99913e0d52acd52067ad5a7be29e99a3 /nsprpub/pr/src/md/unix/uxshm.c
parent13e9a0c06d35bb02d211df873c105a350aeab8eb (diff)
downloadUXP-7c728b3c7680662fc4e92b5d03697b8339560b08.tar
UXP-7c728b3c7680662fc4e92b5d03697b8339560b08.tar.gz
UXP-7c728b3c7680662fc4e92b5d03697b8339560b08.tar.lz
UXP-7c728b3c7680662fc4e92b5d03697b8339560b08.tar.xz
UXP-7c728b3c7680662fc4e92b5d03697b8339560b08.zip
Update NSPR to 4.16
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 );