1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-14 17:08:22 +00:00

Ensure posix_spawn is used to execute ping when available

We want to avoid the memory copy when possible, and python
will not try posix_spawn unless close_fds=False

https://github.com/rtomayko/posix-spawn#linux
This commit is contained in:
J. Nick Koston 2023-11-15 09:28:25 -06:00
parent 20ea8bf06e
commit a30c248c93
No known key found for this signature in database

View File

@ -1068,6 +1068,7 @@ async def _async_ping_host(host: str) -> bool:
stdin=asyncio.subprocess.DEVNULL,
stdout=asyncio.subprocess.DEVNULL,
stderr=asyncio.subprocess.DEVNULL,
close_fds=False, # Required for posix_spawn
)
await process.wait()
return process.returncode == 0