mirror of
https://github.com/esphome/esphome.git
synced 2025-02-15 09:28:16 +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:
parent
20ea8bf06e
commit
a30c248c93
@ -1068,6 +1068,7 @@ async def _async_ping_host(host: str) -> bool:
|
|||||||
stdin=asyncio.subprocess.DEVNULL,
|
stdin=asyncio.subprocess.DEVNULL,
|
||||||
stdout=asyncio.subprocess.DEVNULL,
|
stdout=asyncio.subprocess.DEVNULL,
|
||||||
stderr=asyncio.subprocess.DEVNULL,
|
stderr=asyncio.subprocess.DEVNULL,
|
||||||
|
close_fds=False, # Required for posix_spawn
|
||||||
)
|
)
|
||||||
await process.wait()
|
await process.wait()
|
||||||
return process.returncode == 0
|
return process.returncode == 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user