diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-02-06 11:40:35 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-06 11:40:35 +0100 |
commit | 7c728b3c7680662fc4e92b5d03697b8339560b08 (patch) | |
tree | 4a0da02f99913e0d52acd52067ad5a7be29e99a3 /nsprpub/pr/src/md/unix/uxshm.c | |
parent | 13e9a0c06d35bb02d211df873c105a350aeab8eb (diff) | |
download | UXP-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.c | 44 |
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 ); |