git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] maintenance: compare output of pthread functions for inequality with 0

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Dec 2, 2022, 18:05 UTC
Message-ID
<34ed06a2-9c67-62d5-7985-4b7379a0cf6c@jeffhostetler.com>
In-Reply-To
<pull.1389.git.git.1670000578395.gitgitgadget@gmail.com>
On 12/2/22 12:02 PM, Rose via GitGitGadget wrote:
Show 26 quoted lines
> From: Seija <doremylover123@gmail.com>
> 
> The documentation for pthread_create and pthread_sigmask state that:
> 
> "On success, pthread_create() returns 0;
> on error, it returns an error number"
> 
> As such, we ought to check for an error
> by seeing if the output is not 0.
> 
> Checking for "less than" is a mistake
> as the error code numbers can be greater than 0.
> 
> Signed-off-by: Seija <doremylover123@gmail.com>
> ---
>      maintenance: compare output of pthread functions for inequality with 0
>      
>      The documentation for pthread_create and pthread_sigmask state that "On
>      success, pthread_create() returns 0; on error, it returns an error
>      number, and the contents of *thread are undefined."
>      
>      As such, we ought to check for an error by seeing if the output is not
>      0, rather than being less than 0, since nothing stops these functions
>      from returning a positive number.
>      
>      Signed-off by: Seija doremylover123@gmail.com
Good catch!
LGTM

Thanks, Jeff

Previous: Rose via GitGitGadgetNext: Ævar Arnfjörð Bjarmason
Message 2 of 7 in “maintenance: compare output of pthread functions for inequality with 0”
  1. maintenance: compare output of pthread functions for inequality with 0Rose via GitGitGadget, Dec 2, 2022
  2. Jeff HostetlerDec 2, 2022
  3. Ævar Arnfjörð BjarmasonDec 2, 2022
  4. Jeff HostetlerDec 2, 2022
  5. brian m. carlsonDec 2, 2022
  6. Ævar Arnfjörð BjarmasonDec 2, 2022
  7. brian m. carlsonDec 3, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.