From d357575b2b17472080bb318c6c987b90c832eba6 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 11 Mar 2026 22:43:01 +0100 Subject: [PATCH] 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. --- docs/src/process.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/process.rst b/docs/src/process.rst index f15dcf610..5d5be5aae 100644 --- a/docs/src/process.rst +++ b/docs/src/process.rst @@ -259,7 +259,8 @@ API Initializes the process handle and starts the process. If the process is successfully spawned, this function will return 0. Otherwise, the 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) the file to execute not existing, not having permissions to use the setuid or