Skip to content

Commit

Permalink
Fix documented return value
Browse files Browse the repository at this point in the history
On success, this function will return the result of CreateProcessW
which upstream docs say will be "nonzero":
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw#return-value
  • Loading branch information
adamwight committed Feb 26, 2025
1 parent 41875a7 commit 43ef51f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions erts/emulator/sys/win32/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,9 +1482,11 @@ static int escape_and_quote(wchar_t *str, wchar_t *new, BOOL *quoted) {
* executable name.
*
* Results:
* The return value is FALSE if there was a problem creating the child process.
* Otherwise, the return value is 0 and *phPid is
* filled with the process id of the child process.
* The return value is FALSE if there was a problem creating the child process.
*
* When successful, the return value is nonzero, *phPid is filled with the
* process handle of the child process, and *pdwID is filled with its
* process ID.
*
* Side effects:
* A process is created.
Expand All @@ -1503,12 +1505,12 @@ create_child_process
HANDLE hStdout, /* The standard output handle for child. */
HANDLE hStderr, /* The standard error handle for child. */
LPHANDLE phPid, /* Pointer to variable to received Process handle. */
LPDWORD pdwID, /* Pointer to variable to received Process ID */
LPDWORD pdwID, /* Pointer to variable to received Process ID */
BOOL hide, /* Hide the window unconditionally. */
LPVOID env, /* Environment for the child */
wchar_t *wd, /* Working dir for the child */
wchar_t *wd, /* Working dir for the child */
unsigned st, /* Flags for spawn, tells us how to interpret origcmd */
wchar_t **argv, /* Argument vector if given. */
wchar_t **argv, /* Argument vector if given. */
int *errno_return /* Place to put an errno in case of failure */
)
{
Expand Down

0 comments on commit 43ef51f

Please sign in to comment.