Commit 7bb3c04b93 for qemu.org

commit 7bb3c04b934eae0b12d5613b5440074f3e8989f0
Author: Brad Smith <brad@comstyle.com>
Date:   Fri Oct 30 19:07:03 2026 -0400

    qga: fix uname() return value check in guest-get-osinfo

    POSIX only specifies that uname() returns a non-negative value on
    success. Solaris returns 1, so guest-get-osinfo treated every
    successful call as a failure and reported a stale errno.

    Check for a negative return value instead, as linux-user/uname.c
    already does.

    Signed-off-by: Brad Smith <brad@comstyle.com>
    Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Message-ID: <auUjFweAHtj1YSFt@humpty.home.comstyle.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index ae53eb3569..39e772b3ff 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1336,7 +1336,7 @@ GuestOSInfo *qmp_guest_get_osinfo(Error **errp)

     info = g_new0(GuestOSInfo, 1);

-    if (uname(&kinfo) != 0) {
+    if (uname(&kinfo) < 0) {
         error_setg_errno(errp, errno, "uname failed");
     } else {
         info->kernel_version = g_strdup(kinfo.version);