Process.Kill: don't throw for exited processes (dotnet/corefx#36184)
authorTom Deseyn <tom.deseyn@gmail.com>
Fri, 22 Mar 2019 14:01:33 +0000 (15:01 +0100)
committerStephen Toub <stoub@microsoft.com>
Fri, 22 Mar 2019 14:01:33 +0000 (10:01 -0400)
commit666fb7df7447823e4b1528d2eed94f319f0bfbb6
tree2da89ebb6efc946f218dac45fcb1a8afee2b5415
parentd54236f9e4870f9429505fe14b51a383e1d1ff5a
Process.Kill: don't throw for exited processes (dotnet/corefx#36184)

* Process.Kill: don't throw for exited processes

Implements https://github.com/dotnet/corefx/issues/35257

* Fix exception type

* Fix Windows build failure

* Windows: avoid HasExited side-effects, Unix: refactor code a bit

* Unix: fix error code check

* Refactor test to eliminate timeouts

* Remove !HasExited checks before Process.Kill calls

Commit migrated from https://github.com/dotnet/corefx/commit/1a04816bf3c5be25de09c6cfbb4290752583713b
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.NonUap.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs
src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs
src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.netcoreapp.cs
src/libraries/System.Diagnostics.Process/tests/ProcessTestBase.cs
src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
src/libraries/System.Diagnostics.Process/tests/ProcessTests.netcoreapp.cs
src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Unix.cs