Uh oh!
There was an error while loading. Please reload this page.
std: Child::kill() returns error if process has already exited - #49461
Conversation
This patch makes it clear in std::process::Child::kill()'s API documentation that an error is returned if the child process has already cleanly exited. This is implied by the example, but not called out explicitly.
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
Could we note which error is returned, at least on common platforms, though we should indicate it's not guaranteed to be the case.
Certainly we could. Helpfully, @whimboo provided an example of such an error in https://bugzilla.mozilla.org/show_bug.cgi?id=1448900#c3. I’ve referenced When you say it is not guaranteed that it returns an error if the process has already exited, which systems are you referring to? |
Mark-Simulacrum
commented
Mar 29, 2018
I meant that the error returned today on a given system might change down the road and/or other situations could return new errors; we can't guarantee stability of underlying OS APIs. |
andreastt
commented
Mar 29, 2018
And do you think the amendment resolves this issue? Specifically it |
Mark-Simulacrum
commented
Mar 29, 2018
I'd rather leave that as |
andreastt
commented
Mar 29, 2018
Thanks for your feedback. I’ve pushed another fixup which takes that into consideration. Let me know what you think. |
shepmaster
commented
Mar 30, 2018
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
r=me with the nit fixed
| /// | ||
| /// [`ErrorKind`]: ../io/enum.ErrorKind.html | ||
| /// [`InvalidInput`]: ../io/enum.ErrorKind.html#variant.InvalidInput | ||
| /// [`Other]: ../io/enum.ErrorKind.html#variant.Other |
shepmaster
commented
Apr 7, 2018
Ping from triage @andreastt — you have a review comment to address! |
andreastt
commented
Apr 8, 2018
Sorry about that; nit addressed. |
emilyalbini
commented
Apr 16, 2018
Ping from triage @Mark-Simulacrum! The user addressed your comments. |
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
r=me with the nit fixed
| impl Child { | ||
| /// Forces the child to exit. This is equivalent to sending a | ||
| /// SIGKILL on unix platforms. | ||
| /// Forces the child process to exit. If the child has already exited, an [`InvalidInput`] |
There was a problem hiding this comment.
nit: Double space after the period.
emilyalbini
commented
Apr 23, 2018
Ping from triage @Mark-Simulacrum! The user addressed your comments. |
Mark-Simulacrum
commented
Apr 23, 2018
@bors r+ rollup |
bors
commented
Apr 23, 2018
📌 Commit bc4bd56 has been approved by |
…-Simulacrum std: Child::kill() returns error if process has already exited This patch makes it clear in std::process::Child::kill()'s API documentation that an error is returned if the child process has already cleanly exited. This is implied by the example, but not called out explicitly.
Rollup of 11 pull requests Successful merges: - #49461 (std: Child::kill() returns error if process has already exited) - #49727 (Add Cell::update) - #49812 (Fix revision support for UI tests.) - #49829 (Add doc links to `std::os` extension traits) - #49906 (Stabilize `std::hint::unreachable_unchecked`.) - #49970 (Deprecate Read::chars and char::decode_utf8) - #49985 (don't see issue #0) - #50118 (fix search bar bug) - #50139 (encourage descriptive issue titles) - #50174 (Use FxHashMap in syntax_pos::symbol::Interner::intern.) - #50185 (core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`) Failed merges:
This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited. This is implied by the example, but not
called out explicitly.