Closed Bug 483626 Opened 11 years ago Closed 11 years ago

nsIProcess.isRunning doesn't fail correctly and should be boolean

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: mossop, Assigned: mossop)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

isRunning should be a boolean attribute and in certain cases it doesn't report failures back to the caller.
Blocks: 442393
Attached patch patch rev 1Splinter Review
This covers a few problems in nsIProcess. In particular:

nsIProcess.kill should throw if the process hasn't been started or has already been killed (I'm throing NS_ERROR_NOT_INITIALIZED to distinguish from a real failure to kill).

isRunning should be a boolean.

mProcess is only used on non windows API, so remove it from the class there.

GetIsRunning can bail out quickly if we have never started the process, or already killed it.

If the return from GetExitCodeProcess indicates a failure then we should pass that failure back.

GetPid shouldn't modify the out parameter when it returns a failure.

A bit of tidying up in Kill, and close the thread handle when done.

A few cleanups in the tests to make failures easier to trace back to the specific checks.
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #367633 - Flags: review?(benjamin)
Attachment #367633 - Flags: review?(benjamin) → review+
Pushed: http://hg.mozilla.org/mozilla-central/rev/5092d98e31ad
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Comment on attachment 367633 [details] [diff] [review]
patch rev 1

This corrects a few oddities with bug 442393 and so if we take that we should take this on 1.9.1 too.
Attachment #367633 - Flags: approval1.9.1?
Comment on attachment 367633 [details] [diff] [review]
patch rev 1

a191=beltzner
Attachment #367633 - Flags: approval1.9.1? → approval1.9.1+
Depends on: 484747
No longer depends on: 484747
You need to log in before you can comment on or make changes to this bug.