Date: Sun, 17 Apr 2011 16:18:45 +0000 (UTC) From: Mikolaj Golub <trociny@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r220744 - in head/sbin: hastctl hastd Message-ID: <201104171618.p3HGIj6i042986@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trociny Date: Sun Apr 17 16:18:45 2011 New Revision: 220744 URL: http://svn.freebsd.org/changeset/base/220744 Log: 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) Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/hast_proto.c head/sbin/hastd/hast_proto.h Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Sun Apr 17 16:07:08 2011 (r220743) +++ head/sbin/hastctl/hastctl.c Sun Apr 17 16:18:45 2011 (r220744) @@ -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); Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Sun Apr 17 16:07:08 2011 (r220743) +++ head/sbin/hastd/hast_proto.c Sun Apr 17 16:18:45 2011 (r220744) @@ -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); -} Modified: head/sbin/hastd/hast_proto.h ============================================================================== --- head/sbin/hastd/hast_proto.h Sun Apr 17 16:07:08 2011 (r220743) +++ head/sbin/hastd/hast_proto.h Sun Apr 17 16:18:45 2011 (r220744) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104171618.p3HGIj6i042986>