diff options
author | Gleydson Soares <gsoares@cvs.openbsd.org> | 2016-10-10 02:26:25 +0000 |
---|---|---|
committer | Gleydson Soares <gsoares@cvs.openbsd.org> | 2016-10-10 02:26:25 +0000 |
commit | 9d9d0562c177dd800a8cf1fd2269b2e164fe9564 (patch) | |
tree | b7b84436f76570f489d4c3eb865f466d00b2bdaf /usr.sbin/eigrpd | |
parent | 0c493a9e58dc0e27879063fb71caa08e35848dfe (diff) |
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@
Diffstat (limited to 'usr.sbin/eigrpd')
-rw-r--r-- | usr.sbin/eigrpd/tlv.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <renato@openbsd.org> @@ -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; |