From owner-svn-src-head@FreeBSD.ORG Sun Apr 17 16:18:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C4D51065672; Sun, 17 Apr 2011 16:18:46 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3FDA8FC22; Sun, 17 Apr 2011 16:18:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3HGIjcx042990; Sun, 17 Apr 2011 16:18:45 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3HGIj6i042986; Sun, 17 Apr 2011 16:18:45 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201104171618.p3HGIj6i042986@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 17 Apr 2011 16:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220744 - in head/sbin: hastctl hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2011 16:18:46 -0000 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);