diff options
author | ngie <ngie@FreeBSD.org> | 2016-05-14 23:13:23 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-05-14 23:13:23 +0000 |
commit | 18c52ab8782b079caaf8d3bbec693fd844942257 (patch) | |
tree | d0fb80b8ce42b70279ecd602456700df01f19748 /usr.sbin/bsnmpd | |
parent | f4b91b6a83b0b182cc50346860dda6d160745a58 (diff) | |
download | FreeBSD-src-18c52ab8782b079caaf8d3bbec693fd844942257.zip FreeBSD-src-18c52ab8782b079caaf8d3bbec693fd844942257.tar.gz |
Do minimal work necessary to cure a -Wunused-but-set-variable warning from gcc
How errno is saved before and restored after strtoul calls needs a rethink
MFC after: 1 week
Reported by: gcc 5.x
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'usr.sbin/bsnmpd')
-rw-r--r-- | usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c index 54644d6..6d83078 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c @@ -778,11 +778,11 @@ parse_ntp_ts(struct snmp_value *sv, char *val) saved_errno = errno; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { - saved_errno = errno; + errno = saved_errno; warnx("Integer value %s not supported", val); return (-1); } else - saved_errno = errno; + errno = saved_errno; if (*endptr != '.') { warnx("Failed reading octet - %s", val); @@ -799,11 +799,11 @@ parse_ntp_ts(struct snmp_value *sv, char *val) saved_errno = errno; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { - saved_errno = errno; + errno = saved_errno; warnx("Integer value %s not supported", val); return (-1); } else - saved_errno = errno; + errno = saved_errno; for (i = 0, d = 1000; i < 4; i++) { ntp_ts[i + 4] = v / d; |