From e7b69599b7fb052bff6e0f0f33ca074733ffa137 Mon Sep 17 00:00:00 2001 From: gsoares Date: Mon, 10 Oct 2016 02:26:24 +0000 Subject: calls to uname(3) should be checked against non-negative value upon successful and -1 on failure (as per POSIX). No functional change, just improves portability. requested by guenther@ looks correct to schwarze@ OK renato@ --- usr.sbin/eigrpd/tlv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/eigrpd') diff --git a/usr.sbin/eigrpd/tlv.c b/usr.sbin/eigrpd/tlv.c index 464ddd75e39..3e64c5317e9 100644 --- a/usr.sbin/eigrpd/tlv.c +++ b/usr.sbin/eigrpd/tlv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlv.c,v 1.14 2016/09/02 16:46:29 renato Exp $ */ +/* $OpenBSD: tlv.c,v 1.15 2016/10/10 02:26:24 gsoares Exp $ */ /* * Copyright (c) 2015 Renato Westphal @@ -103,7 +103,7 @@ gen_sw_version_tlv(struct ibuf *buf) memset(&ts, 0, sizeof(ts)); ts.type = htons(TLV_TYPE_SW_VERSION); ts.length = htons(TLV_TYPE_SW_VERSION_LEN); - if (uname(&u) == 0) { + if (uname(&u) >= 0) { if (sscanf(u.release, "%u.%u", &vendor_os_major, &vendor_os_minor) == 2) { ts.vendor_os_major = (uint8_t) vendor_os_major; -- cgit v1.2.3-59-g8ed1b