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

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

From
JKJakub Kulik <jakub.kulik@oracle.com>
Date
Nov 18, 2026, 16:01 UTC
Message-ID
<20261118160146.60429-2-jakub.kulik@oracle.com>
In-Reply-To
<xmqqcxs9j1bp.fsf@gitster.g>

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.
 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);
-- 
2.50.1
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.