This commit is contained in:
Rian Drake 2026-10-15 14:09:11 +13:00
commit b578433e37

View file

@ -0,0 +1,20 @@
using System.Diagnostics;
namespace Brutal.Monitor.Common
{
internal static class ProcessExtension
{
public static void WriteLineSync(this Process process, string line)
{
// Called from crash handlers, so a dead child's broken pipe must never throw
try
{
lock (process.StandardInput)
process.StandardInput.WriteLine(line);
}
catch (IOException) { }
catch (ObjectDisposedException) { }
catch (InvalidOperationException) { }
}
}
}