Clean up trailing and leading whitespace

Fix variable type alignment in snmp_dialog(..)

MFC after:	1 week
This commit is contained in:
Enji Cooper 2016-12-18 05:31:54 +00:00
parent 28fded59b4
commit 7c25494706

View File

@ -1236,23 +1236,23 @@ snmp_send_packet(struct snmp_pdu * pdu)
return (-1);
}
pdu->request_id = snmp_next_reqid(&snmp_client);
pdu->request_id = snmp_next_reqid(&snmp_client);
b.asn_ptr = buf;
b.asn_len = snmp_client.txbuflen;
if (snmp_pdu_encode(pdu, &b)) {
b.asn_ptr = buf;
b.asn_len = snmp_client.txbuflen;
if (snmp_pdu_encode(pdu, &b)) {
seterr(&snmp_client, "%s", strerror(errno));
free(buf);
return (-1);
}
if (snmp_client.dump_pdus)
snmp_pdu_dump(pdu);
if (snmp_client.dump_pdus)
snmp_pdu_dump(pdu);
if ((ret = send(snmp_client.fd, buf, b.asn_ptr - buf, 0)) == -1) {
if ((ret = send(snmp_client.fd, buf, b.asn_ptr - buf, 0)) == -1) {
seterr(&snmp_client, "%s", strerror(errno));
free(buf);
return (-1);
return (-1);
}
free(buf);
@ -1548,7 +1548,7 @@ ok_getnext(const struct snmp_pdu * req, const struct snmp_pdu * resp)
&resp->bindings[i].var)) {
if (i != 0)
warnx("SNMP GETNEXT: inconsistent table "
"response");
"response");
return (0);
}
if (resp->version != SNMP_V1 &&
@ -1681,12 +1681,12 @@ snmp_pdu_check(const struct snmp_pdu *req,
int
snmp_dialog(struct snmp_v1_pdu *req, struct snmp_v1_pdu *resp)
{
u_int i;
int32_t reqid;
int ret;
struct timeval tv = snmp_client.timeout;
struct timeval tv = snmp_client.timeout;
struct timeval end;
struct snmp_pdu pdu;
u_int i;
int32_t reqid;
int ret;
/*
* Make a copy of the request and replace the syntaxes by NULL
@ -1699,10 +1699,10 @@ snmp_dialog(struct snmp_v1_pdu *req, struct snmp_v1_pdu *resp)
pdu.bindings[i].syntax = SNMP_SYNTAX_NULL;
}
for (i = 0; i <= snmp_client.retries; i++) {
for (i = 0; i <= snmp_client.retries; i++) {
(void)gettimeofday(&end, NULL);
timeradd(&end, &snmp_client.timeout, &end);
if ((reqid = snmp_send_packet(&pdu)) == -1)
if ((reqid = snmp_send_packet(&pdu)) == -1)
return (-1);
for (;;) {
(void)gettimeofday(&tv, NULL);
@ -1723,10 +1723,10 @@ snmp_dialog(struct snmp_v1_pdu *req, struct snmp_v1_pdu *resp)
/* stream closed */
return (-1);
}
}
}
errno = ETIMEDOUT;
seterr(&snmp_client, "retry count exceeded");
return (-1);
return (-1);
}
int