]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
uname always returns -1 on error on all supported platforms, so test for that.
authorRoy Marples <roy@marples.name>
Tue, 26 Jul 2016 15:52:15 +0000 (15:52 +0000)
committerRoy Marples <roy@marples.name>
Tue, 26 Jul 2016 15:52:15 +0000 (15:52 +0000)
dhcp-common.c

index 20b4efa3a3005000045223f7f76bcefd9cfc78c1..ac9b1cd78f94f92d38e13e0249a46aeee43f19d4 100644 (file)
@@ -170,7 +170,7 @@ dhcp_vendor(char *str, size_t len)
        char *p;
        int l;
 
-       if (uname(&utn) != 0)
+       if (uname(&utn) == -1)
                return (ssize_t)snprintf(str, len, "%s-%s",
                    PACKAGE, VERSION);
        p = str;