doc: clarify handle close behavior of uv_spawn (#5055)

Contrary to how most handle init functions work, callers of uv_spawn
must always call uv_close, even if it returned an error.
This commit is contained in:
Ben Noordhuis 2026-03-11 22:43:01 +01:00 committed by GitHub
parent 6cdf71da80
commit d357575b2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -259,7 +259,8 @@ API
Initializes the process handle and starts the process. If the process is Initializes the process handle and starts the process. If the process is
successfully spawned, this function will return 0. Otherwise, the successfully spawned, this function will return 0. Otherwise, the
negative error code corresponding to the reason it couldn't spawn is negative error code corresponding to the reason it couldn't spawn is
returned. returned. Note that either way you must eventually call :c:func:`uv_close`
to close the handle again.
Possible reasons for failing to spawn would include (but not be limited to) Possible reasons for failing to spawn would include (but not be limited to)
the file to execute not existing, not having permissions to use the setuid or the file to execute not existing, not having permissions to use the setuid or