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

Re: [PATCH] version: accept positive uname(2) return values

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 18, 2026, 17:11 UTC
Message-ID
<xmqqjyma6p59.fsf@gitster.g>
In-Reply-To
<20261118160146.60429-2-jakub.kulik@oracle.com>
Jakub Kulik <jakub.kulik@oracle.com> writes:
Show 6 quoted lines
> POSIX specifies that uname(2) can return any non-negative value on
> success. Update the get_uname_info() check to follow this.
>
> Signed-off-by: Jakub Kulik <jakub.kulik@oracle.com>
> ---
> Thank you. Hope this is how it should look.
Perfect.  Thanks.
Show 17 quoted lines
>
>  version.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/version.c b/version.c
> index 21ec7c0fbe..ca3be6d610 100644
> --- a/version.c
> +++ b/version.c
> @@ -83,7 +83,7 @@ int get_uname_info(struct strbuf *buf, unsigned int full)
>  {
>  	struct utsname uname_info;
>  
> -	if (uname(&uname_info)) {
> +	if (uname(&uname_info) < 0) {
>  		strbuf_addf(buf, _("uname() failed with error '%s' (%d)\n"),
>  			    strerror(errno),
>  			    errno);
Previous: Jakub Kulik
Message 4 of 4 in “uname check fails on Solaris due to different return value”
  1. Jakub KulikNov 12, 2026
  2. Junio C HamanoNov 12, 2026
  3. version: accept positive uname(2) return valuesJakub Kulik, Nov 18, 2026
  4. Junio C HamanoNov 18, 2026

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.