diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
commit | f7d30133221896638f7bf4f66c504255c4b14f48 (patch) | |
tree | 5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/src/md/windows/w32ipcsem.c | |
parent | 26b297510a11758727438df4669357a2a2bc42ce (diff) | |
download | UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip |
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/pr/src/md/windows/w32ipcsem.c')
-rw-r--r-- | nsprpub/pr/src/md/windows/w32ipcsem.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/nsprpub/pr/src/md/windows/w32ipcsem.c b/nsprpub/pr/src/md/windows/w32ipcsem.c index 954591002..500009352 100644 --- a/nsprpub/pr/src/md/windows/w32ipcsem.c +++ b/nsprpub/pr/src/md/windows/w32ipcsem.c @@ -18,17 +18,19 @@ static HANDLE OpenSemaphore(DWORD inDesiredAccess, HANDLE retval = NULL; HANDLE semaphore = NULL; PRUnichar wideName[MAX_PATH]; /* name size is limited to MAX_PATH */ - + MultiByteToWideChar(CP_ACP, 0, inName, -1, wideName, MAX_PATH); /* 0x7fffffff is the max count for our semaphore */ semaphore = CreateSemaphoreW(NULL, 0, 0x7fffffff, wideName); if (NULL != semaphore) { DWORD lastErr = GetLastError(); - - if (ERROR_ALREADY_EXISTS != lastErr) + + if (ERROR_ALREADY_EXISTS != lastErr) { CloseHandle(semaphore); - else + } + else { retval = semaphore; + } } return retval; } @@ -97,8 +99,8 @@ static DWORD FiberSafeWaitForSingleObject( warg.handle = hHandle; warg.timeout = dwMilliseconds; waitThread = PR_CreateThread( - PR_USER_THREAD, WaitSingleThread, &warg, - PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); + PR_USER_THREAD, WaitSingleThread, &warg, + PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); if (waitThread == NULL) { return WAIT_FAILED; } @@ -133,7 +135,7 @@ PRSem *_PR_MD_OPEN_SEMAPHORE( } if (flags & PR_SEM_CREATE) { if (_PR_NT_MakeSecurityDescriptorACL(mode, semAccessTable, - &pSD, &pACL) == PR_SUCCESS) { + &pSD, &pACL) == PR_SUCCESS) { sa.nLength = sizeof(sa); sa.lpSecurityDescriptor = pSD; sa.bInheritHandle = FALSE; @@ -142,7 +144,7 @@ PRSem *_PR_MD_OPEN_SEMAPHORE( #ifdef WINCE { /* The size of a sem's name is limited to MAX_PATH. */ - PRUnichar wosname[MAX_PATH]; + PRUnichar wosname[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, osname, -1, wosname, MAX_PATH); sem->sem = CreateSemaphoreW(lpSA, value, 0x7fffffff, wosname); } @@ -165,7 +167,7 @@ PRSem *_PR_MD_OPEN_SEMAPHORE( } } else { sem->sem = OpenSemaphore( - SEMAPHORE_MODIFY_STATE|SYNCHRONIZE, FALSE, osname); + SEMAPHORE_MODIFY_STATE|SYNCHRONIZE, FALSE, osname); if (sem->sem == NULL) { DWORD err = GetLastError(); |