diff options
author | trociny <trociny@FreeBSD.org> | 2011-04-17 16:18:45 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2011-04-17 16:18:45 +0000 |
commit | 4ef25c883e5478b277d1dd30131a89b0fb577390 (patch) | |
tree | f3d9e28d6e9dd67e05c06bb0994870ab00550b6c | |
parent | 1584693544b770829a7352a4644c0d9ef46f5747 (diff) | |
download | FreeBSD-src-4ef25c883e5478b277d1dd30131a89b0fb577390.zip FreeBSD-src-4ef25c883e5478b277d1dd30131a89b0fb577390.tar.gz |
Remove hast_proto_recv(). It was used only in one place, where
hast_proto_recv_hdr() may be used. This also fixes the issue
(introduced by r220523) with hastctl, which crashed on assert in
hast_proto_recv_data().
Suggested and approved by: pjd (mentor)
-rw-r--r-- | sbin/hastctl/hastctl.c | 2 | ||||
-rw-r--r-- | sbin/hastd/hast_proto.c | 18 | ||||
-rw-r--r-- | sbin/hastd/hast_proto.h | 2 |
3 files changed, 1 insertions, 21 deletions
diff --git a/sbin/hastctl/hastctl.c b/sbin/hastctl/hastctl.c index 21b1217..0ab0bd4 100644 --- a/sbin/hastctl/hastctl.c +++ b/sbin/hastctl/hastctl.c @@ -491,7 +491,7 @@ main(int argc, char *argv[]) } nv_free(nv); /* ...and receive reply. */ - if (hast_proto_recv(NULL, controlconn, &nv, NULL, 0) < 0) { + if (hast_proto_recv_hdr(controlconn, &nv) < 0) { pjdlog_exit(EX_UNAVAILABLE, "cannot receive reply from hastd via %s", cfg->hc_controladdr); diff --git a/sbin/hastd/hast_proto.c b/sbin/hastd/hast_proto.c index 8f53baa..70175b6 100644 --- a/sbin/hastd/hast_proto.c +++ b/sbin/hastd/hast_proto.c @@ -219,21 +219,3 @@ end: free(dptr); return (ret); } - -int -hast_proto_recv(const struct hast_resource *res, struct proto_conn *conn, - struct nv **nvp, void *data, size_t size) -{ - struct nv *nv; - int ret; - - ret = hast_proto_recv_hdr(conn, &nv); - if (ret < 0) - return (ret); - ret = hast_proto_recv_data(res, conn, nv, data, size); - if (ret < 0) - nv_free(nv); - else - *nvp = nv; - return (ret); -} diff --git a/sbin/hastd/hast_proto.h b/sbin/hastd/hast_proto.h index b48c3ca..49f3b56 100644 --- a/sbin/hastd/hast_proto.h +++ b/sbin/hastd/hast_proto.h @@ -39,8 +39,6 @@ int hast_proto_send(const struct hast_resource *res, struct proto_conn *conn, struct nv *nv, const void *data, size_t size); -int hast_proto_recv(const struct hast_resource *res, struct proto_conn *conn, - struct nv **nvp, void *data, size_t size); int hast_proto_recv_hdr(const struct proto_conn *conn, struct nv **nvp); int hast_proto_recv_data(const struct hast_resource *res, struct proto_conn *conn, struct nv *nv, void *data, size_t size); |