Closed Bug 552105 Opened 14 years ago Closed 14 years ago

PR_OpenSemaphore does not set the error code properly on Windows CE

Categories

(NSPR :: NSPR, defect)

ARM
Windows CE
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: alexp, Assigned: wtc)

Details

Attachments

(1 file, 1 obsolete file)

PR_OpenSemaphore called for a non-existing semaphore is expected to set the error code to PR_FILE_NOT_FOUND_ERROR, but instead it sets it to PR_UNKNOWN_ERROR on Windows CE.
Assignee: wtc → alexp
Status: NEW → ASSIGNED
Attached patch Fix (obsolete) — Splinter Review
Set the last error in our own implementation of the OpenSemaphore function for WinCE to the same value as in the native NT version of the function.
Attachment #432249 - Flags: review?(bugmail)
Attachment #432249 - Flags: review?(wtc)
Attachment #432249 - Flags: review?(bugmail)
Attachment #432249 - Flags: review+
Comment on attachment 432249 [details] [diff] [review]
Fix

r=wtc.

What's the original error code set by CreateSemaphoreW
in this case?

>+            /* The semaphore did not exist, so we set the last error like OpenSemaphore on NT */

Nit: wrap this long line (it seems longer than 80 characters).
Is there a better name for regular Windows than "NT"?

>+        }
>         else

Nit: This should be formatted as
          } else
Attachment #432249 - Flags: review?(wtc) → review+
(In reply to comment #2)
> What's the original error code set by CreateSemaphoreW
> in this case?

In this case CreateSemaphoreW just successfully creates a new semaphore, so the last error code is zero. We expect OpenSemaphore to fail though, so we just close the newly opened semaphore and set the error code to what is expected by other functions.

> >+            /* The semaphore did not exist, so we set the last error like OpenSemaphore on NT */
> 
> Nit: wrap this long line (it seems longer than 80 characters).
> Is there a better name for regular Windows than "NT"?

There is a difference between Windows NT and 95 in this case. The function _PR_MD_OPEN_SEMAPHORE below has a comment about this. So the name "NT" is consistent and makes sense here. I will put "Windows NT" there though to add a bit more context.
Attached patch Fix v2Splinter Review
Minor changes as per the code review.
Attachment #432249 - Attachment is obsolete: true
Attachment #432615 - Flags: review+
Assignee: alexp → wtc
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: