Skip to content

Commit

Permalink
Bug 1526010, NSPR_4_21_BETA2, r=me
Browse files Browse the repository at this point in the history
UPGRADE_NSPR_RELEASE
  • Loading branch information
kaie committed Feb 21, 2019
1 parent 28ffbff commit 83f1b6e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion nsprpub/TAG-INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NSPR_4_21_BETA1
NSPR_4_21_BETA2
1 change: 0 additions & 1 deletion nsprpub/config/prdepend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
*/

#error "Do not include this header file."

36 changes: 18 additions & 18 deletions nsprpub/pr/src/md/unix/unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
** Global lock variable used to bracket calls into rusty libraries that
** aren't thread safe (like libc, libX, etc).
*/
static PRLock *_pr_rename_lock = NULL;
static PRLock *_pr_unix_rename_lock = NULL;
static PRMonitor *_pr_Xfe_mon = NULL;

static PRInt64 minus_one;
Expand Down Expand Up @@ -204,8 +204,8 @@ PRInt32 _MD_rename(const char *from, const char *to)
** of an existing file. Holding a lock across these two function
** and the open function is known to be a bad idea, but ....
*/
if (NULL != _pr_rename_lock)
PR_Lock(_pr_rename_lock);
if (NULL != _pr_unix_rename_lock)
PR_Lock(_pr_unix_rename_lock);
if (0 == access(to, F_OK))
PR_SetError(PR_FILE_EXISTS_ERROR, 0);
else
Expand All @@ -216,8 +216,8 @@ PRInt32 _MD_rename(const char *from, const char *to)
_PR_MD_MAP_RENAME_ERROR(err);
}
}
if (NULL != _pr_rename_lock)
PR_Unlock(_pr_rename_lock);
if (NULL != _pr_unix_rename_lock)
PR_Unlock(_pr_unix_rename_lock);
return rv;
}

Expand Down Expand Up @@ -260,15 +260,15 @@ int rv, err;
** This lock is used to enforce rename semantics as described
** in PR_Rename. Look there for more fun details.
*/
if (NULL !=_pr_rename_lock)
PR_Lock(_pr_rename_lock);
if (NULL !=_pr_unix_rename_lock)
PR_Lock(_pr_unix_rename_lock);
rv = mkdir(name, mode);
if (rv < 0) {
err = _MD_ERRNO();
_PR_MD_MAP_MKDIR_ERROR(err);
}
if (NULL !=_pr_rename_lock)
PR_Unlock(_pr_rename_lock);
if (NULL !=_pr_unix_rename_lock)
PR_Unlock(_pr_unix_rename_lock);
return rv;
}

Expand Down Expand Up @@ -2219,8 +2219,8 @@ PRInt32 _MD_open(const char *name, PRIntn flags, PRIntn mode)
if (flags & PR_CREATE_FILE)
{
osflags |= O_CREAT;
if (NULL !=_pr_rename_lock)
PR_Lock(_pr_rename_lock);
if (NULL !=_pr_unix_rename_lock)
PR_Lock(_pr_unix_rename_lock);
}

#if defined(ANDROID)
Expand All @@ -2234,8 +2234,8 @@ PRInt32 _MD_open(const char *name, PRIntn flags, PRIntn mode)
_PR_MD_MAP_OPEN_ERROR(err);
}

if ((flags & PR_CREATE_FILE) && (NULL !=_pr_rename_lock))
PR_Unlock(_pr_rename_lock);
if ((flags & PR_CREATE_FILE) && (NULL !=_pr_unix_rename_lock))
PR_Unlock(_pr_unix_rename_lock);
return rv;
}

Expand Down Expand Up @@ -2871,8 +2871,8 @@ void _PR_UnixInit(void)
rv = sigaction(SIGPIPE, &sigact, 0);
PR_ASSERT(0 == rv);

_pr_rename_lock = PR_NewLock();
PR_ASSERT(NULL != _pr_rename_lock);
_pr_unix_rename_lock = PR_NewLock();
PR_ASSERT(NULL != _pr_unix_rename_lock);
_pr_Xfe_mon = PR_NewMonitor();
PR_ASSERT(NULL != _pr_Xfe_mon);

Expand All @@ -2881,9 +2881,9 @@ void _PR_UnixInit(void)

void _PR_UnixCleanup(void)
{
if (_pr_rename_lock) {
PR_DestroyLock(_pr_rename_lock);
_pr_rename_lock = NULL;
if (_pr_unix_rename_lock) {
PR_DestroyLock(_pr_unix_rename_lock);
_pr_unix_rename_lock = NULL;
}
if (_pr_Xfe_mon) {
PR_DestroyMonitor(_pr_Xfe_mon);
Expand Down

0 comments on commit 83f1b6e

Please sign in to comment.